Auth0 Home Blog Docs

Refresh token support issue

Hi there,
I implemented the authentication flow ,s2s, in my web app according your tutorial about nodejs + passport.
now i am trying to add refresh mechanism to it but encountered difficulties.

First, according your docs, refresh token mechanism is supported out of the box in your sdks, thats mean that if i used the passport-auth0 it should work automatically?
secondly, i didnt find any reference of how to implement refresh token mechanism with auth0 + passport.

i can always get the refresh token and manually use it to retrieve new access token with the auth API, but i thought this mechanism already included.

Please if someone can clarify and explain how should i do that or send a reference?

Thanks

Hi @yuvalz,

Welcome to the Auth0 Community Forum!

In this instance it would be useful to see the implementation where you request the refresh token and try and use it to request a new access token.

If you could post the code with any sensitive data removed that would be helpful!

Thanks,
Dan

i am sure i wont have problem to use the refresh token in order to grant a new access token. that wasnt my point. i just wonder if there is built in support for refresh token mechanism, if there is one i would be happy to see code example.

Are you using the auth0-node package? And the refreshToken method?

https://auth0.github.io/node-auth0/index.html

https://auth0.github.io/node-auth0/module-auth.AuthenticationClient.html#refreshToken

thanks, i got it. but it will be great if passport-auth0 will support refresh token as well. currently i am not using the node-auth0 package you mentioned because i am managing sessions in my app and passport-auth0 handle almost everything i need. the only missing piece is the refresh token. so now i should use another library.

@yuvalz,

Using a refresh token is explained here:

You can select ‘node’ and get an example implementation in node.

If you have a feature request please submit it on the GitHub repo for that library:

Hope this helps!

Thanks,
Dan

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.