cti-passport-jwt-bearer-strategy

1.0.3 • Public • Published

cti-passport-jwt-bearer-strategy

A Passport strategy for authenticating requests based on CTI bearer tokens and assigning relevant scopes.

Usage

const express = require( 'express' );
const passport = require( 'passport' );

const key = 'key';
const issuer = 'issuer';
const audience = 'audience';

const strategy = require( './../lib/jwtBearerStrategy' )(
    key,
    { issuer: issuer, audience: audience }
);

passport.use( strategy );

const bearerAuthenticator =
    passport.authenticate( strategy.name, { session: false } );

const app = express();
express.get( '/', bearerAuthenticator, ( req, res ) => {
    res.send( 'You\'ve authenticated!' );
} );

/cti-passport-jwt-bearer-strategy/

    Package Sidebar

    Install

    npm i cti-passport-jwt-bearer-strategy

    Weekly Downloads

    0

    Version

    1.0.3

    License

    MIT

    Last publish

    Collaborators

    • jeffreycharles