Not getting refresh token with google oauth2

217 views Asked by At

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.

1

There are 1 answers

0
Hans Z. On BEST ANSWER

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.