Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

symblight-fastify-oauth2-jwt

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

symblight-fastify-oauth2-jwt

### Requirements

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Getting started

Requirements

This package supports the following tooling versions:

  • Node.js: ^12.19.0 || ^14.15.0 || ^16.13.0 || ^18.12.0

Installation

Using npm in your project directory run the following command:

npm install symblight-fastify-oauth2-jwt

Getting started

Environment Variables
ISSUER_BASE_URL=https://YOUR_ISSUER_DOMAIN
AUDIENCE=https://my-api.com
const { fastifyOauth2 } = require("symblight-fastify-oauth2-jwt");
app.register(fastifyOauth2, {
  audience: "",
  issuerBaseURL: ``,
  jwksUri: "",
  algorithms: ["RS256"],
});
const checkJwt = async (req, reply) => {
  const jwt = app.Oauth2.getToken(
    req.headers,
    req.query,
    req.body,
    !!reply.header("Content-type", "urlencoded")
  );
  return await app.Oauth2.verifyJwt(jwt);
};

app.get("/", async function (request, reply) {
  request.auth = await checkJwt(request, reply);
  return reply
    .status(200)
    .header("Content-Type", "application/json; charset=utf-8")
    .send(request.auth?.payload);
});

FAQs

Package last updated on 13 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc