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
It looks like we're returning different responses for bad username and bad password (same message, but different statuses). I don't think we want the user to be able to distinguish between them.
Interestingly, Flask may be doing the something similar, although, I think they are doing the reverse: they are returning 401 for a non-existent user and 403 for unauthorized credentials, whereas we are returning 401 for a bad password and 403 for a bad username.
webbnh
changed the title
It looks like the server is returning different responses for bad username and bad password (same message, but different statuses). I don't think we want the user to be able to distinguish between them.
It looks like the server is returning different responses for bad username and bad password
Mar 24, 2021
@webbnh interesting, btw its not flask but an author of the Flask-HTTPAuth package. When I wrote that status code I followed https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401, it says 401 is for when the request lacks valid authentication credentials (such as bad password). 403 is forbidden and re-authenticating will make no difference (because we dont have such a user)
403 is for a operation that is attempting to execute some action requiring access, but is denied (either because the client is not authenticated, or is authenticated but the authenticated user does not have access).
It looks like we're returning different responses for bad username and bad password (same message, but different statuses). I don't think we want the user to be able to distinguish between them.
Originally posted by @webbnh in #1937 (comment)
The text was updated successfully, but these errors were encountered: