-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Not authorized error when selecting wrong account. #147
Comments
+1. Should be an escape out from "Not Authorized". |
I'll double check this again |
Just tested this and confirmed this is still the behaviour - currently the auth cookie will still be generated for an invalid user which I believe is a bug. I've added the user verification into a local branch, but I need to decide on the best way to handle it it, I'll do a bit more testing on options. |
I'm still unsure on the best way to handle this, the two options I see:
I think 1. is the better option, I welcome any other feedback on this |
Number one is the best option to me. I don't know if it's already implemented, but a custom redirect URI for Not Authorized would be great. So we could design our own redirect schema. For example I would just load an HTML with a "Ops!, you are not authorized to view this page, click here to go back to login". |
I'm also running into this. I'd be fine with either option, although I think in most cases services tend to just use option 2 and redirect back to the app which then redirects back to the identity provider. |
For Google OAuth, if the "prompt" parameter were available as an option, it could be set to "select_account" which forces an account selection. https://developers.google.com/identity/protocols/oauth2/web-server |
Any update on this? |
I've had a go at fixing it in #286 by clearing the auth cookie, specifically when the 401 Not authorized prompt is displayed because a user's email address is not valid. I've also amending the message to prompt the user to refresh the page to try again. It's a bit blunt and could definitely be done more elegantly but I'm not familiar with GO or this project's source code is it's about the best that I can manage and will hopefully enough until someone can come along with a more elegant solution. |
I am still seeing the #103 problem even after upgrading to 2.2.0 (thomseddon/traefik-forward-auth:v2.2.0). If i choose the email in the whitelist then it works properly and i am redirected to my original page, but if i choose the wrong email by mistake then i end with the "Not authorized" message and no way out until i delete the cookies.
My configuration is the following (using Auth Host Mode and Selective Authentication):
Environment:
Credential file contents
The protected service has the following label:
I can see the following in the logs:
The log is expected since i choose the wrong account, but IMO it should redirect to the auth page and never show the error message on the page (or show the error page with a button to login again).
The text was updated successfully, but these errors were encountered: