Skip to content

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

@vwiencek

Description

@vwiencek

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions