How to use the passport-jwt.ExtractJwt.versionOneCompatibility function in passport-jwt

To help you get started, we’ve selected a few passport-jwt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ghaiklor / generator-sails-rest-api / generators / authentication / templates / config / passport.js View on Github external
*/
const LOCAL_STRATEGY_CONFIG = {
  usernameField: 'email',
  passwordField: 'password',
  session: false,
  passReqToCallback: true
};

/**
 * Configuration object for JWT strategy
 * @type {Object}
 * @private
 */
const JWT_STRATEGY_CONFIG = {
  secretOrKey: '<%= options["secret-key"] %>',
  jwtFromRequest: ExtractJwt.versionOneCompatibility({authScheme: 'Bearer', tokenBodyField: 'access_token'}),
  tokenQueryParameterName: 'access_token',
  session: false,
  passReqToCallback: true
};

/**
 * Configuration object for social strategies
 * @type {Object}
 * @private
 */
const SOCIAL_STRATEGY_CONFIG = {
  clientID: '-',
  clientSecret: '-',
  consumerKey: '-',
  consumerSecret: '-',
  passReqToCallback: true
github gregoryguillou / terraform-api / api / api / models / jwt.js View on Github external
'use strict'

const { ExtractJwt } = require('passport-jwt')
const YAML = require('yamljs')
const secretOrKey = YAML.load('config/settings.yaml').jwt.secretOrKey

const params = {
  secretOrKey,
  jwtFromRequest: ExtractJwt.versionOneCompatibility({authScheme: 'Bearer'})
}

module.exports = params