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
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 objectThis 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