Not receiving Google OAuth refresh token

前端 未结 14 1409
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 07:38

I want to get the access token from Google. The Google API says that to get the access token, send the code and other parameters to token generating page, and the response

14条回答
  •  感情败类
    2020-11-22 08:40

    now google had refused those parameters in my request (access_type, prompt)... :( and there is no "Revoke Access" button at all. I'm frustrating because of getting back my refresh_token lol

    UPDATE: I found the answer in here :D you can get back the refresh token by a request https://developers.google.com/identity/protocols/OAuth2WebServer

    curl -H "Content-type:application/x-www-form-urlencoded" \ https://accounts.google.com/o/oauth2/revoke?token={token}

    The token can be an access token or a refresh token. If the token is an access token and it has a corresponding refresh token, the refresh token will also be revoked.

    If the revocation is successfully processed, then the status code of the response is 200. For error conditions, a status code 400 is returned along with an error code.

提交回复
热议问题