Google api refresh_token null

350 阅读1分钟

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.
but

requestServerAuthCode(String serverClientId)

替换成

requestServerAuthCode(String serverClientId, boolean forceCodeForRefreshToken)

you can get refresh_token every time.