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
davidism
changed the title
Authorization refactoring in version 2.3.0 is a breaking change from version 2.2.3request.authorization["token"] is not set
Apr 26, 2023
OK, I see what's going on. Previously, we didn't support anything except basic and digest auth, and Flask-HTTPAuth worked around that by using a token key. However, now we actually support schemes with tokens, as auth.token. Looks like there's already a PR to address that, although they need to figure out compatibility: miguelgrinberg/Flask-HTTPAuth#159
I have a project using
Flask==2.2.2
Flask-HTTPAuth==4.7.0
It was working fine. Today the tests started to fail without any source code change.
I traced the problem and looks like it is caused by these refactorings
#2619
Flask-HTTPAuth use a code like
https://github.com/miguelgrinberg/Flask-HTTPAuth/blob/main/src/flask_httpauth.py#L395
token = auth['token']
But now this returns None.
Now Authorization.from_headers() returns an object that has
auth.token
but does not work asauth['token']
Also see: miguelgrinberg/Flask-HTTPAuth#160
The text was updated successfully, but these errors were encountered: