-
-
Notifications
You must be signed in to change notification settings - Fork 228
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
Token is None
in containerized setup
#161
Comments
Same versions of everything? You are likely using different versions of Flask, Werkzeug or Flask-HTTPAuth. I suggest you make sure you use the most up to date version of Flask-HTTPAuth, the recent releases of Flask broke some functionality that I had to fix. |
I am on |
What about werkzeug? Did you have all the same versions compared to your working case locally? |
|
Well, then I do not know. You must be missing some difference between the working and non working cases. The use of containers does not affect the way this extension works in any way, so I don't see how that can cause this. |
I'll update you here if I find out more |
Hi @miguelgrinberg ,
This is the combination that didn't work (python 3.8)-
|
@zivsh222 Thanks for the additional information. There were some compatibility issues with the release of Flask 2.3, but those are fixed in the 4.8.0 version. I'm testing with the |
Hi @miguelgrinberg ,
Also, we're using the decorator as |
@zivsh222 You can't send a token with the Flask 2.3 uses a more robust parser for the |
@miguelgrinberg , I don't have access to the calling API, I just implemented the app that gets the requests, but looking here It looks like it is in use. (we use HTTPS) |
The example you linked shows username and password, that is not a token. Run the code through a base64 decoder to see the actual credentials. |
I solved this issue by changing my Werkzeug version to 2.2.3, i.e, I ran pip install Werkzeug==2.2.3 and added this line to my requirements.txt: Werkzeug==2.2.3 It was failing with these: Flask==2.1.0
Flask-HTTPAuth==4.7.0
Werkzeug==2.3.6 And it is now working with these: Flask==2.1.0
Flask-HTTPAuth==4.7.0
Werkzeug==2.2.3 All 2.3. versions cause failure. |
@LachlanGreen this is not a great solution. As I explained above, the problem is that your application is incorrectly using the |
I am experiencing this too, using the Bearer scheme. Think something is wrong. |
Upgrade to 4.8.0 of flask-httpauth as there were improvements in getting the token from the auth packet. That fixed it for me. flask==2.3.3 |
Posting here as I'm struggling to find information in other corners of the web.
I'm running Flask on a Kubernetes Pod and struggling to properly authenticate my requests.
I should note that when I run this setup locally via
flask run
everything works as expected.Any hints, tips, suggestions greatly appreciated.
The text was updated successfully, but these errors were encountered: