草庐IT

Passport

全部标签

node.js - NodeJS jwtStrategy 需要一个函数来从请求错误中检索 jwt

我从https://devdactic.com/restful-api-user-authentication-1/学习了教程。但是我在这部分有错误passport.use(newJwtStrategy(opts,function(jwt_payload,done)这是我运行Node“server.js”时的错误/home/chibi/Documents/connect/project/node_modules/passport-jwt/lib/strategy.js:39thrownewTypeError('JwtStrategyrequiresafunctiontoretrieve

node.js - NodeJS jwtStrategy 需要一个函数来从请求错误中检索 jwt

我从https://devdactic.com/restful-api-user-authentication-1/学习了教程。但是我在这部分有错误passport.use(newJwtStrategy(opts,function(jwt_payload,done)这是我运行Node“server.js”时的错误/home/chibi/Documents/connect/project/node_modules/passport-jwt/lib/strategy.js:39thrownewTypeError('JwtStrategyrequiresafunctiontoretrieve

node.js - 我是否实现了 NodesJS + Passport + RedisStore 的序列化和反序列化?

我是否实现了序列化和反序列化?RedisStore设置为我与Express的session存储。这是否意味着我没有实现序列化和反序列化?它会自动发生吗?当我不实现这些方法时,我会收到以下Express错误-500错误:无法将用户序列化到session中。当我实现它们时,我不确定在反序列化中放入什么。下面的代码似乎可以工作,但session没有持续。每次访问该网站时,我都需要登录。有没有NodeJS+Passport+RedisStore的好例子?varsessionStore=newRedisStore({host:rtg.hostname,port:rtg.port,db:redis

node.js - 我是否实现了 NodesJS + Passport + RedisStore 的序列化和反序列化?

我是否实现了序列化和反序列化?RedisStore设置为我与Express的session存储。这是否意味着我没有实现序列化和反序列化?它会自动发生吗?当我不实现这些方法时,我会收到以下Express错误-500错误:无法将用户序列化到session中。当我实现它们时,我不确定在反序列化中放入什么。下面的代码似乎可以工作,但session没有持续。每次访问该网站时,我都需要登录。有没有NodeJS+Passport+RedisStore的好例子?varsessionStore=newRedisStore({host:rtg.hostname,port:rtg.port,db:redis

javascript - Passport 推特 : failed to find request token in session

就在昨天在Heroku上,我开始在快速登录Twitter时遇到此错误Error:failedtofindrequesttokeninsessionatStrategy.(/app/node_modules/passport-twitter/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth.js:120:54)atStrategy.authenticate(/app/node_modules/passport-twitter/lib/passport-twitter/strategy.js:82:40)atPa

javascript - Passport 推特 : failed to find request token in session

就在昨天在Heroku上,我开始在快速登录Twitter时遇到此错误Error:failedtofindrequesttokeninsessionatStrategy.(/app/node_modules/passport-twitter/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth.js:120:54)atStrategy.authenticate(/app/node_modules/passport-twitter/lib/passport-twitter/strategy.js:82:40)atPa

node.js - Node.js Passport 的 Google 策略上的自定义 returnUrl

我正在使用Express和PassportOpenIDGoogle策略,我想在每个身份验证请求上设置returnURL,以便能够返回到启动该身份验证的页面。情况是我有带有Node.js后端的HTML5幻灯片应用程序(以及社交内容和编辑器以及门户和扩展...https://github.com/bubersson/humla),我希望能够在某些幻灯片上登录用户(通过幻灯片menu...)但我希望他能轻松回到同一张幻灯片。所以我需要这样的东西?app.get('/auth/google',function(req,res){varcust="http://localhost:1338/"+

node.js - Node.js Passport 的 Google 策略上的自定义 returnUrl

我正在使用Express和PassportOpenIDGoogle策略,我想在每个身份验证请求上设置returnURL,以便能够返回到启动该身份验证的页面。情况是我有带有Node.js后端的HTML5幻灯片应用程序(以及社交内容和编辑器以及门户和扩展...https://github.com/bubersson/humla),我希望能够在某些幻灯片上登录用户(通过幻灯片menu...)但我希望他能轻松回到同一张幻灯片。所以我需要这样的东西?app.get('/auth/google',function(req,res){varcust="http://localhost:1338/"+

node.js - Passport-Facebook 不提供电子邮件,即使它在范围内

在我的应用程序中,我注册了facebook-strategie,如下所示:但是返回的配置文件不包含电子邮件字段....passport.use(newFacebookStrategy({clientID:config.facebook.clientID,clientSecret:config.facebook.clientSecret,callbackURL:config.facebook.callbackURL,passReqToCallback:true},function(req,accessToken,refreshToken,profile,done){//Noemailin

node.js - Passport-Facebook 不提供电子邮件,即使它在范围内

在我的应用程序中,我注册了facebook-strategie,如下所示:但是返回的配置文件不包含电子邮件字段....passport.use(newFacebookStrategy({clientID:config.facebook.clientID,clientSecret:config.facebook.clientSecret,callbackURL:config.facebook.callbackURL,passReqToCallback:true},function(req,accessToken,refreshToken,profile,done){//Noemailin