Skip to content
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

refresh_token missing #242

Open
i-polaris opened this issue Jan 4, 2023 · 3 comments
Open

refresh_token missing #242

i-polaris opened this issue Jan 4, 2023 · 3 comments

Comments

@i-polaris
Copy link

Hello guys,

I'm facing to one issue with the refesh token,
btw i check my gmail-json.json and inside i have the access_token but i didn't have the refresh_token which create some issues

my allow_multiple_credentials is false,

does anyone met this issue before ?

Best

@i-polaris
Copy link
Author

Ok btw i found why after google search :)

https://stackoverflow.com/questions/10827920/not-receiving-google-oauth-refresh-token

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 the page showing Apps with access to your account: https://myaccount.google.com/u/0/permissions.
Under the Third-party apps menu, choose your app.
Click Remove access and then click Ok to confirm
The next OAuth2 request you make will return a refresh_token (providing that it also includes the 'access_type=offline' query parameter.
Alternatively, you can add the query parameters prompt=consent&access_type=offline 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.

@dokicro
Copy link

dokicro commented Oct 16, 2023

@i-polaris you are a life saver!!!

@zhelinskyy
Copy link

Ok btw i found why after google search :)

https://stackoverflow.com/questions/10827920/not-receiving-google-oauth-refresh-token

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 the page showing Apps with access to your account: https://myaccount.google.com/u/0/permissions. Under the Third-party apps menu, choose your app. Click Remove access and then click Ok to confirm The next OAuth2 request you make will return a refresh_token (providing that it also includes the 'access_type=offline' query parameter. Alternatively, you can add the query parameters prompt=consent&access_type=offline 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.

you are genius thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants