-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
AUTH_REMOTE_USER reads REMOTE_USER variable instead of HTTP_REMOTE_USER #2014
Comments
Thank you for opening the issue. I believe HTTP headers can be renamed using a reverse proxy. Having said that, I understand this is not flexible enough. Would be an improvement to create a new config key to set this header name with |
Hi @dpgaspar, what do you mean by "I believe HTTP headers can be renamed using a reverse proxy."? That's precisely what I reported I could not do in #1764 (comment), did I miss anything obvious? |
Hi @dpgaspar ! Any update on this issue ? As @slmg and myself already stated, no matter what the reverse proxy sets as header in the forwarded request, it will be prefixed with I therefore believe that FAB will always get Maybe testing for both variable names could be a solution ? |
I think that adding a new config key with a default to |
Ref PR should address this, will release soon |
Reopening #1764
Environment
Flask-Appbuilder version: 3.4.1
pip freeze output:
Describe the expected results
When using FAB with
AUTH_TYPE = AUTH_REMOTE_USER
behind a reverse proxy which sets the request headerREMOTE_USER
, FAB should authenticate that user when trying to loginDescribe the actual results
Authentication fails with message
Invalid login. Please try again.
when clicking "login" link.Steps to reproduce
config.py
to setAUTH_TYPE = AUTH_REMOTE_USER
Invalid login. Please try again.
Potential lead
I believe CGI uses HTTP request headers as environment variable by prefixing them with
HTTP_
(https://www.ietf.org/rfc/rfc3875, section 4.1.18). However FAB readsREMOTE_USER
in flask_appbuilder/security/views.py.Patching the code as follow seems to fix the problem:
The text was updated successfully, but these errors were encountered: