【发布时间】:2020-04-18 12:27:22
【问题描述】:
Google Plus 代币策略:
passport.use('googleToken', new GooglePlusTokenStrategy({
clientID: 'adf',
clientSecret: 'asdf'
}, (accessToken, refreshToken, profile, done) => {
console.log(accessToken);
console.log(profile);
return done(false, profile)
}));
我从安卓客户端传递
access_token作为查询字符串。
accessToken 和 profile 已使用任何 cliendId 和 clientSecret 成功检索!那么使用这些密钥的目的是什么?
顺便说一句,只有Android google plus 身份验证需要clientID,但服务器端(Nodejs)也需要clientSecret!但是这个clientSecret不是由google console为android凭据生成的
【问题讨论】:
-
我的理解是需要有效的客户端 ID 和密码才能获得访问令牌。一旦访问令牌可用,它就会在没有客户端 ID 和密码的情况下使用。
标签: javascript node.js authentication ionic3 passport.js