espresso3389 / oauth2_custom_uri_scheme

A Flutter plugin that implements Authorizaion code grant with browser redirect support.
https://pub.dev/packages/oauth2_custom_uri_scheme/
MIT License
2 stars 0 forks source link

Refresh token and API requests #6

Closed Tiger3030 closed 4 years ago

Tiger3030 commented 4 years ago

Hello,

I use the package to access the trakt.tv API. With the help of the provided example I managed to authorize and also to revoke access. For further use I have two questions:

  1. How can I use a refresh token to get a new access token?
  2. Where is the access token stored and how can I use it to send requests to the API?

Thank you for your help.

espresso3389 commented 4 years ago

AccessToken has two methods, refresh and refreshIfNeede for refreshing access token.

And, you can get the access token string by accessToken.

The class also equips several wrapper specialized for common use. But you can of course create your http request by your hand.