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

Asking for refresh_token and dealing with fetching new access_token when it expired #91

Open
vwiencek opened this issue Sep 16, 2016 · 1 comment

Comments

@vwiencek
Copy link

I'm using spring social google to get access to users's email informations. As i'm performing background operations, I need a way to refresh the token when it expires without asking the user to authorize the application again.

I figured out that we could get a refresh token by adding the following parameters to the OAuth2Parameters object

params.set("access_type", "offline");
params.set("approval_prompt","force");

This will force google OAuth mechanism to provide a refresh_token. Then when the access_token expires, we can exchange the refresh_token for a new access_token.

thx

@tinmegali
Copy link

Hello @vwiencek, did you manage to find a work around this issue?
I investigated the source code, however, I was incapable of finding a way to configure the OAuth2Parameters using the spring-social-google as it is? Am I missing something?
tks

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

2 participants