问题是oauth2登录无法正常使用https://github.com/golang/oauth2/库。谷歌oauth2显示审批提示每次登录
Github工作得很好,并且在我批准后不会显示审批提示。 但Google oauth2在每次登录时显示批准提示。
下面的url是golang oauth2生成的auth URL。我没有发现它的问题。
https://accounts.google.com/o/oauth2/auth?client_id=my_client_id&redirect_uri=redirect_url&response_type=code&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.login+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.profile.emails.read&state=state
该文档(https://developers.google.com/youtube/v3/guides/authentication)表示默认的approval_prompt值为auto。
我已经正确批准了API测试应用程序。 并从权限页面确认(https://security.google.com/settings/security/permissions)
然后,https://accounts.google.com/o/oauth2/auth再次显示审批提示。 我已经双重检查了approval_prompt不是'强制'。