Skip to content
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

add support for refresh token #4

Closed
vgrafe opened this issue Sep 23, 2019 · 6 comments
Closed

add support for refresh token #4

vgrafe opened this issue Sep 23, 2019 · 6 comments

Comments

@vgrafe
Copy link
Contributor

vgrafe commented Sep 23, 2019

First of all, thanks for this great library, the struggle was so real before I came across your nextjs example!

As requested in sandrinodimattia/nextjs-auth0-example#2 :

A good feature for the next release would be to store refresh token, in order to allow getting new access tokens when needed.

@sandrinodimattia
Copy link
Member

Fixed in v0.2.0. You'll want to request the offline_access scope in addition to any other scopes and then set storeRefreshToken to true.

There's some additional things we're tracking here: #7

@sandrinodimattia
Copy link
Member

Let me know if we can close this issue.

@vgrafe
Copy link
Contributor Author

vgrafe commented Sep 25, 2019

That was fast!! I'll have a look after work.

@b2times4
Copy link

Brilliant + fast = brilliant.
I'll (kindly) "need" sandrinodimattia/nextjs-auth0-example to be updated for implementation.
I managed to get the example implemented as is, but brain not large enough to update it with refresh_token

@vgrafe
Copy link
Contributor Author

vgrafe commented Sep 25, 2019

Just tried 0.2.0, perfect! I can see the token in the JTW session. You can close.

@b2times4: you might want to file an issue in the repo you linked. I'll mention you if I find myself figuring out a working example of token refresh.

@sandrinodimattia
Copy link
Member

We now have a full example available that shows how to get a valid access token (and if expired, automatically get a new one using a refresh token):

https://github.com/auth0/nextjs-auth0/blob/master/examples/api-call-example/pages/api/shows.js#L9-L11

I'm going to go ahead and close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants