Skip to content
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

SECURITY_MANAGER_CLASS not being picked up in webserver_config.py #36875

Closed
1 of 2 tasks
CharlieJ15420 opened this issue Jan 18, 2024 · 8 comments
Closed
1 of 2 tasks
Labels

Comments

@CharlieJ15420
Copy link

CharlieJ15420 commented Jan 18, 2024

Apache Airflow version

2.8.0

If "Other Airflow 2 version" selected, which one?

No response

What happened?

I've just upgraded from 2.7.3 to 2.8.0 and have my own custom security manager. This custom security manager inherited from AirflowSecurityManager. Now I've upgraded to 2.8.0 I've altered my security manager to inherit from FabAirflowSecurityManagerOverride. Despite this, my custom security manager isn't being picked up. I've made no changes to webserver_config.py where I've specified the SECURITY_MANAGER_CLASS. It should pick up my custom sec manager via this line: https://github.com/apache/airflow/blob/2.8.0/airflow/auth/managers/fab/fab_auth_manager.py#L340 however when I try to login, not only do I get invalid login but the errors in the logs are coming from override.py (where the base FabAirflowSecurityManagerOverride lives) compared to my customsecuritymanager.py. I'm not sure if something else has changed that I need to alter or if there is a bug somewhere that isnt picking up my custom security manager class.

note: I'm also using the default fab auth manager

What you think should happen instead?

My custom security manager should be picked up and used. I've verified it's not being picked up by putting in an incorrect name which in the past has produced an error.

How to reproduce

Try to set your own SECURITY_MANAGER_CLASS in webserver_config.py and inherit from FabAirflowSecurityManagerOverride.

Operating System

CentOS7

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@CharlieJ15420 CharlieJ15420 added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Jan 18, 2024
Copy link

boring-cyborg bot commented Jan 18, 2024

Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

@o-nikolas
Copy link
Contributor

CC @vincbeck

@CharlieJ15420
Copy link
Author

Even if I put the entire custom security manager class in webserver_config.py it still doesn't pick it up. I can see webserver_config.py is in the correct dir once deployed too.

@CharlieJ15420
Copy link
Author

Not quite, as the webserver starts fine - it's just not picking up my custom security manager at all.

@potiuk
Copy link
Member

potiuk commented Jan 20, 2024

Can you share your webserver_config.py ? Maybe you have a typo there of some sort ?

@RNHTTR RNHTTR added pending-response and removed needs-triage label for new issues that we didn't triage yet labels Jan 20, 2024
@vdozal
Copy link

vdozal commented Jun 9, 2024

Hi @CharlieJ15420, did you solve this issue? I'm having the same, I added log messages and don't see them, plus I get this message when trying to login:
The request to sign in was denied.

@WRinnovation
Copy link

While migrating from 2.4.0 to 2.10.0 I noticed that in the Webserver documentation of 2.8.0 it used SECURITY_MANAGER_CLASS instead of the previous version FAB_SECURITY_MANAGER_CLASS, in addition to using the new class FabAirflowSecurityManagerOverride.

Changing this is what fixed it for me, altough I did not find an official migration guide stating this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants