且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在使用oAuth和***进行身份验证时,为什么在第二次身份验证尝试时总是收到错误:invalid_grant?

更新时间:2023-12-03 10:51:34

I found a way to fix this (at least for us). When redirecting to the accounts.google.com/o/oauth2/auth url, we had to add both approval_prompt=force and access_type=offline. If one was missing, we got no refresh token.

This url documents all of the parameters, but says nothing about the refresh token: http://code.google.com/apis/accounts/docs/OAuth2WebServer.html