vapor-community / Imperial

Federated Authentication with OAuth providers
MIT License
153 stars 48 forks source link

Add logic for pulling and saving refresh tokens on sessions #71

Open SpaceboatDVLP opened 3 years ago

SpaceboatDVLP commented 3 years ago

It would be great to integrate the ability to pull and save refresh tokens on a session.

I was able to get this working locally for the Google oAuth service by adding access_type=offline&, at which point the refresh token gets returned from the Google API similar to the current flow for pulling and saving an access token.

This would be helpful for workflows where the user grants permission to the web app once, then the app periodically refreshes the access token with the refresh token behind the scenes and continues to interoperate with the linked account.

Cheers, and great library!