您的位置:首页 > 编程语言 > Go语言

google api , the problem of null refresh token

2014-12-21 20:42 330 查看
http://stackoverflow.com/questions/10827920/google-oauth-refresh-token-is-not-being-received

The
refresh_token
is only provided on the first authorization from the user. Subsequent authorizations, such as the kind you make while testing an OAuth2 integration, will not return the
refresh_token
again. :)

Go to your account security settings: https://www.google.com/settings/u/1/security.

Click the edit button next to "Authorizing applications and sites".

Then click "Revoke Access" next to your app.

The next OAuth2 request you make will return a
refresh_token
.

Alternatively, you can add the query parameter
approval_prompt=force
to the OAuth redirect (see Google's OAuth 2.0 for Web Server Applications page).

This will prompt the user to authorize the application again and will always return a
refresh_token
.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: