You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
Consider Authorize attributes and authorization filters that restrict with a specific criteria. [Authorize(Roles = "Developers")]
The current and classic behavior of authorization filters and attributes is to send a 401 response if their criteria aren't met. If there is no authenticated user, this is entirely correct as it will trigger the authentication flow. However, if there is already an authenticated user, sending a 401 just puts them into an infinite authentication loop.
Possible solutions:
If the user used the wrong auth type, a specific challenge for the required auth type should be issued.
Sending a 403 (Forbidden) would inform them that they were authenticated, but they still lack the necessary permissions for the given resource. The infrastructure may choose to redirect 403s to a detailed error page.
The text was updated successfully, but these errors were encountered:
Tratcher
changed the title
Authorize attributes/filters with criteria should use not use 401 for authenticated users
Authorize attributes/filters with criteria should not use 401 for authenticated users
Jun 6, 2014
Related:
https://katanaproject.codeplex.com/discussions/547633#post1253618
#432
Consider Authorize attributes and authorization filters that restrict with a specific criteria.
[Authorize(Roles = "Developers")]
The current and classic behavior of authorization filters and attributes is to send a 401 response if their criteria aren't met. If there is no authenticated user, this is entirely correct as it will trigger the authentication flow. However, if there is already an authenticated user, sending a 401 just puts them into an infinite authentication loop.
Possible solutions:
The text was updated successfully, but these errors were encountered: