How do I do this in Passport.js?:
When the access token expires, you can use the refresh_token to "refresh" your access, and gain another access_token. To use the refresh_token you need to do a POST request to our token-endpoint with the grant_type set to refresh_token:
https://podio.com/oauth/token?grant_type=refresh_token&client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&refresh_token=REFRESH_TOKEN
I asked Jared if he would consider adding something into the core to make this a little easier to handle. He responded by saying that this should not be handled in the core.
So I wrote a plugin to help: https://github.com/fiznool/passport-oauth2-refresh
answer from Jared Hanson, author PassportJS:
Refresh tokens are something handled entirely on the backend, and not connected to a user's session. For example: set up a cron job, query for tokens about to expire, make POST requests to refresh them.
Passport doesn't get involved in this process, because its separate from authentication.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With