-
Notifications
You must be signed in to change notification settings - Fork 144
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
Automatic logout on refresh with invalid refresh_token instead of throwing exception #280
Comments
Hi @thomasmicro - thanks for raising this
We can't presume this is the desired behaviour. If you've estabilised a session on a webapp, you might not want to remove it just because you can't access an API - this is different from a SPA in that its "session" is defined by whether it can access an API.
The examples are lightweight demonstrations of how to use the API, it would be a bit heavy handed to add error handling to them. In the example you point to - you should also add error handling to the request, so your app doesn't crash if you get an unexpected response from |
Thanks for the answer and sorry for my late reply! I don't quite get in which use-case you want to keep someone logged in if the 'Token is not active'. My favorite solution would be #246 including my comment there. I would really expect to have at least one real-world example that also lists all the edge-cases you need to look for. So that for a completly normal use-case you can just copy&paste the pieces together and have production-grade code. Best Regards! |
Step up auth is one use case I can think of.
I think it's beyond the scope of those examples to do this, they're just simple demonstrations of how to use the api
Thanks for your comment, we're going to stick with the API as it is for now, and you'll have to write those couple of lines yourself to refresh the token. But we're always reviewing the API, so will take it into consideration if this feature proves to be popular. |
Describe the problem
If a refresh using invalidated refresh_token is tried using the example-code, the whole nodeJS-App crashes. It is basically the same Issue as auth0/auth0-spa-js#668 on the client-side.
What was the expected behavior?
In case an automatic logout is not desired, the exception-handling should be documented in the examples.
Reproduction
My example is basically https://github.com/auth0/express-openid-connect/blob/master/EXAMPLES.md#5-obtaining-and-using-refresh-tokens or https://github.com/auth0/express-openid-connect/blob/master/examples/access-an-api.js.
The logs show:
Environment
The text was updated successfully, but these errors were encountered: