-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google does not return refresh token and the token does not refresh automatically #2591
Comments
I have the same problem |
No one? |
I had the same problem. You have to put : $client->setAccessType('offline'); Before generating the authorisation url $client = new Client();
|
I have the same problem and I also did put the setAccessType before createAuthUrl() but still do not work. I have 2 functions, one to generate the Auth Url
And another as callback:
|
Ok, i was able to get the refresh token, by some reason, google only sends you the refresh token for the first time you consent/allow the permission. So you already give the consent/allow you need to revoke the access token, you can do that by going to your google account and removing the permission or with the access token you can revoke that:
The time you request the token the google will send you the refresh token. There is also some claims that this behaviour only happens with some language libs Check More: |
Environment details
Steps to reproduce
This is the generated link https://accounts.google.com/o/oauth2/v2/auth/oauthchooseaccount?response_type=code&access_type=offline&client_id=
But, In the json there is no refresh_token. It only returns
access_token
. And the access token expires 1 hour later and I have to go and repeat the auth process again. Wich is not the case of my app. Because the token is being used in API.Thanks!
The text was updated successfully, but these errors were encountered: