Javascript Auth0-从服务器获取令牌
我正在使用Auth0在服务器上创建和保存用户 用户登录后,我如何访问应用程序中的任何位置的有效令牌Javascript Auth0-从服务器获取令牌,javascript,node.js,auth0,Javascript,Node.js,Auth0,我正在使用Auth0在服务器上创建和保存用户 用户登录后,我如何访问应用程序中的任何位置的有效令牌 var strategy = new Auth0Strategy({ domain: 'foo.eu.auth0.com', clientID: 'xxxxxxxxxx', clientSecret: 'xxxxxxxxx', callbackURL: '/login' }, function(accessToken, refreshTok
var strategy = new Auth0Strategy({
domain: 'foo.eu.auth0.com',
clientID: 'xxxxxxxxxx',
clientSecret: 'xxxxxxxxx',
callbackURL: '/login'
}, function(accessToken, refreshToken, extraParams, profile, done) {
// accessToken is the token to call Auth0 API (not needed in the most cases)
// extraParams.id_token has the JSON Web Token
// profile has all the information from the user
var id_token = extraParams.id_token;
return done(null, profile, id_token);
});
passport.use(strategy);
passport.serializeUser(function(user, done) {
done(null, user);
});
passport.deserializeUser(function(user, done) {
done(null, user);
});
module.exports = strategy;
为什么要保留
访问令牌
?用户身份验证后您将做什么?为什么要保留访问\u令牌?用户身份验证后,您将做什么