我对 google oauth 2 有疑问。我想获取刷新令牌,但它没有出现。从字面上尝试了每种方法来检索刷新令牌,但没有一个起作用。
这是我的代码:
new GoogleStrategy(
{
clientID:"xxxxxxxxxxxxxxx",
clientSecret: "xxxxxxxxxxxxxxx",
callbackURL: "http://localhost:3000/google/callback",
scope: SCOPE,
accessType: "offline",
approvalPrompt: "force",
include_granted_scopes: "true",
},
function (request, access_token, refreshToken, profile, done) {
console.log(refreshToken);
return done(null, profile);
}
)
对此有什么想法吗?为什么我没有得到 refreshToken?