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

Login with code flow throws wrong token_refresh_error instead of token_error #1451

Open
joschi27 opened this issue Nov 14, 2024 · 0 comments

Comments

@joschi27
Copy link

Describe the bug
In the oauth-service.ts the fetchAndProcessToken method throws token_refresh_error when running into an error.

Stackblitz example
Not applicable

To Reproduce
Not applicable

Expected behavior
I would expect to get a token_refresh_error when the token refresh fails, and I would expect to get a token_error when there's an error getting the token initially.

The issue we're running into is that when the Id server doesn't return a token at all, we cannot differenciate between a token error and a refresh token error. When the id server doesn't return a token, we want to display a 401 page, meaning the user cannot access the service and has to be stopped. If it's just a token refresh error, the user can be put back into the login flow. If this distinction cannot be made, we have to sent the user to the 401 in any of those cases. This is annoying for the user as he loses his current working url and gets presented with a 401 page he has to back navigate from (in the best case).

Desktop (please complete the following information):
not applicable

Additional context
I will provide a pull request with this bug report. Please let me know if there is a good reason for throwing a token_refresh_error in the initial code flow request.

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

1 participant