Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@criipto/verify-passport-jwt

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@criipto/verify-passport-jwt

A Passport strategy for authenticating with a Criipto Verify JWT.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
3
-25%
Maintainers
2
Weekly downloads
 
Created
Source

@criipto/verify-passport-jwt

A Passport strategy for authenticating with a Criipto Verify JWT.

Install

npm install @criipto/verify-passport-jwt

Usage

It is currently assumed that the token will be delivered via the Authorization: Bearer {token} header.

import CriiptoVerifyStrategy from '@criipto/verify-passport-jwt';

passport.use(
  'criiptoVerify',
  new CriiptoVerifyStrategy(
    {
      domain: '{YOUR_CRIIPTO_DOMAIN}',
      clientID: '{YOUR_CRIIPTO_APPLICATION_CLIENT_ID}'
    },
    async (jwtClaims) => {
      return User.findOne({id: jwtClaims.sub});
    }
  )
);

Authenticate requests

app.post('/', passport.authenticate('criiptoVerify', { session: false }), (req, res) => {
  res.json(req.user);
});

JWT Payload/Claims

You can find the expected JWT payload/claims contents in the e-ID section of the Criipto docs

Debugging

You can use DEBUG=@criipto/verify-passport-jwt to log errors from this library.

Criipto

Learn more about Criipto and sign up for your free developer account at criipto.com.

Keywords

criipto

FAQs

Package last updated on 28 Jul 2022

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