'Issue in getting jwt from passport node library
I have an angular project & I am using the passport node library. I used the below mentioned multiple ways to get the token from passport library but none of them are working, Can you please suggest, why I am not able to get the token here.
app.js
var passport = require('passport');
var PassportStrategy = require('./prj/authen/PassportStrategy');
app.use(passport.initialize());
passport.use('jwt',PassportStrategy.JWTStrategy);
passport.use('anonymous', new AnonymousStrategy());
PassportStrategy.js
var express = require("express");
var passportJWT = require("passport-jwt");
var ExtractJwt = passportJWT.ExtractJwt;
var JwtStrategy = passportJWT.Strategy;
var jwtOptions = {};
jwtOptions.jwtFromRequest = ExtractJwt.fromAuthHeaderAsBearerToken(); //Not getting token here
jwtOptions.secretOrKey = JWTService.getPublicKey();
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
