简体   繁体   中英

Not getting refresh token with google oauth2

I have the set the scope to ' https://mail.google.com/ ' and the extra params like 'access-type=offline' and 'approval-prompt=force' are also set.

After the process is complete, I'm not getting the refresh token. I only get the access_token, expires_in and token_type fields.

I even revoked the access to the app from the account I used to test and tried multiple times. Still got the same result.

The syntax of the parameters must use underscores as a separator instead of the hyphens you use, so use access_type=offline and approval_prompt=force .

Note that you'll only get a refresh token on the first attempt to connect an application or after revoking access as you already seem to suggest.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM