Getting a refresh token from google api

不想你离开。 提交于 2019-12-12 03:34:51

问题


I've looked through other posts and they're either unanswered (Stopped getting refresh token from google's API) or no longer correct it seems.

I am trying to get a new refresh token from the google api, I have access_type = 'offline' and approval_prompt = 'force' but the response I'm getting back does not contain a refresh token. The other posts I have looked through says that having those two parameters should return me a refresh token.

Any ideas?

EDIT: I was thinking perhaps I could revoke the auth and have the user re-auth to get a fresh refresh_token. Would this work/is there a better solution?


回答1:


I think I figured it out, instead of using approval_prompt=force you can use:

{       
        ...
        access_type='offline',
        prompt='select_account consent'
}

to force a new approval screen and get a new refresh token.



来源:https://stackoverflow.com/questions/34500895/getting-a-refresh-token-from-google-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!