我正在使用这个 Cordova GooglePlus Plugin使用 Google 帐户登录。问题是我只能在第一个请求中获取刷新 token 。我每次都想拥有这个 token 。
我读过添加 prompt=consent
设置将使它在每次登录时都征求同意,我每次都能获得刷新 token 。
我只是不知道在哪里添加这个设置来实现这一点。
我正在登录:
let opts = {
scopes: "SCOPE1 SCOPE2",
webClientId: WEBCLIENTID,
offline: true
}
GooglePlus.login(opts)
任何人都可以帮我解决这个问题吗?
谢谢
最佳答案
您必须将其添加到 authentication request
.
You can prompt the user to re-authorize your app by adding the prompt=consent parameter to the authentication request. When prompt=consent is included, the consent screen is displayed every time the user logs into your app. For this reason, include prompt=consent only when necessary.
Authentication URI parameters - consent
关于cordova - 每次使用 google auth、Cordova + ionic 2 提示同意,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43590630/