-
-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refresh Token missing #222
Comments
I would like some information on this as well, the documentation states that refresh token support is bundled yet shows no examples. Thanks in advance! |
Are you able to help @jaredhanson? |
@benrolfe I got mine working, you simply have to generate a refresh token during the exchange and pass the optional refreshToken parameter to the exchange callback. Below is an example of the callback. Hope that helps! server.exchange(oauth2orize.exchange.code((client, code, redirectUri, done) => {
// Check the auth code
// Destory auth code
// Create access token
// create refresh token
...
return done(null, token, refreshToken, { expires: 3600});
...
}));
|
@jesseg34 Thanks for the tip, that's exactly what I needed. On a related note, when you exchange a refresh token for a new access token, should I expect to receive a new refresh token? This is what I get back after the exchange:
|
This is more of an implementation decision however the short answer is no. Refresh tokens are meant to be long-lived and normally do not expire. Some more reference: |
Does this logic work with the 'basic' strategy? Or is there a need to define your own custom strategy? |
Be aware that for security reasons, some flows do not allow refresh tokens such as implicit grant type flow: https://tools.ietf.org/html/rfc6749#section-9 |
It worked |
When I request my "access token", by passing my "auth token", I was expecting to also receive a "refresh token", however it's missing.
Can someone explain why it's missing, and how I get hold of a refresh token?
This is what's returned...
The text was updated successfully, but these errors were encountered: