-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Add Azure AD OAuth webserver authentication example with role mapping #60756
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
Add Azure AD OAuth webserver authentication example with role mapping #60756
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Shruti,
I'd kindly suggest to read and adhere to the guidelines regarding Gen-AI contributions.
Specifically:
Ensure that you review and understand all code generated by Gen-AI tools before including it in your PR - do not blindly trust the generated code.State in your PR description that you have used Gen-AI tools to assist in creating the PR.
You've created an entire new document regarding the usage of Azure AD in the securty docs of Airflow's core, instead of modifying the existing one in the fab provider - and I do suspect that it's the direct result of uncontrolled AI usage (which is not mentioned as well). Using AI like that makes it difficult for maintainers to assess the reliability and credibility of the contribution.
I'm happy to see your recent activity in the project and I'm aware that you make a lot of effort - but please consider it for your next contributions.
If you want to fix this PR, feel free - but I'll appreciate if you could try to do it without further usage of AI, and test that it actually works.
I'm So Sorry about this - I should have handled it better.
|
Apology accepted :) |
|
Hey @shahar1 , |
|
It would be ideal to test it. Documentation is very important and users rely a lot on it, that's why we should test what we put in documentation |
|
Hi @shahar1 , |
|
Hi @vincbeck @shahar1 @potiuk , I’ve now tested this end-to-end using a real Azure AD tenant. I configured an Azure app registration with OAuth enabled, set up the redirect URI, enabled role/group claims, and used the example webserver_config.py configuration (including a custom SecurityManager) as documented.The OAuth flow completed successfully, including Azure MFA approval, and Airflow authenticated the user and mapped Azure role/group claims to the expected Airflow RBAC role on first login. |
shahar1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done @suii2210 for testing it thoroughly!
If you're ok with it, I'd be happy if you could add a screenshot or two to show the users what it looks like when the configuration is finalized on Azure's UI/CLI (if you choose to do so - please make sure that the image is properly cropped and doesn't expose your personal details).
Please let me know if it works for you, I'm ok with merging it either way.
Thank you!
Yea sure here is the screenshot of the test result .
Example Azure AD app registration authentication settings showing the redirect URI
Example Azure AD token configuration enabling group or role claims for RBAC mapping. |
Thanks! Could you please add them to the instructions (including all the details) and I'll merge? |
Sure, added |
6e45479 to
36aa6db
Compare
36aa6db to
d0ffd7f
Compare
jscheffl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Thanks.




This PR adds an advanced Azure Active Directory OAuth example to
webserver-authentication.rst, including webserver_config.py setup,
a custom SecurityManager for parsing token claims, and role/group
mapping to Airflow RBAC roles.
Note: Gen-AI tools were used to assist with drafting the initial version of this documentation.
The content has been reviewed, revised, and validated manually.
Docs-only change.
Fixes #60748