Skip to content

Conversation

@suii2210
Copy link
Contributor

@suii2210 suii2210 commented Jan 18, 2026

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

Copy link
Contributor

@shahar1 shahar1 left a 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.

@suii2210 suii2210 requested a review from vincbeck as a code owner January 19, 2026 09:06
@suii2210
Copy link
Contributor Author

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.
I missed the Gen-AI disclosure in the PR description and I also placed the Azure AD example in the core security docs instead of extending the existing FAB provider documentation. That was my mistake.
I’ve now fixed this by:

  • Moving the Azure AD example into the existing Flask-AppBuilder webserver authentication docs
  • Removing the standalone core security document
  • Updating the PR description to explicitly disclose Gen-AI usage
  • Reducing the scope to a concrete, example-level addition consistent with existing FAB OAuth examples.

@suii2210 suii2210 requested a review from shahar1 January 19, 2026 09:14
@shahar1
Copy link
Contributor

shahar1 commented Jan 19, 2026

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.
I missed the Gen-AI disclosure in the PR description and I also placed the Azure AD example in the core security docs instead of extending the existing FAB provider documentation. That was my mistake.
I’ve now fixed this by:

  • Moving the Azure AD example into the existing Flask-AppBuilder webserver authentication docs
  • Removing the standalone core security document
  • Updating the PR description to explicitly disclose Gen-AI usage
  • Reducing the scope to a concrete, example-level addition consistent with existing FAB OAuth examples.

Apology accepted :)
It looks better, but still I have no way to assess that it actually works as I don't work with Azure (yet).
Are you (or anyone else, maybe issue's OP) able to test that it works as expected?

@suii2210
Copy link
Contributor Author

Hey @shahar1 ,
I don’t currently have access to an Azure AD tenant to test this end-to-end myself.
The example is based on the existing Flask-AppBuilder OAuth patterns used in the
GitHub and Keycloak examples, and on Azure AD’s documented token claims (groups /
roles) when enabled in the app registration.

@vincbeck
Copy link
Contributor

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

@suii2210
Copy link
Contributor Author

Hi @shahar1 ,
Got the idea behind this example. I’m testing it now and will confirm once it works successfully

@suii2210
Copy link
Contributor Author

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.
Testing was performed against Apache Airflow 3.1.6. The configuration shown in the docs lives in $AIRFLOW_HOME/webserver_config.py (deployment-specific) and is therefore intentionally not included in the repository.
Please let me know if you’d like me to add any additional clarification or notes to the documentation.

Copy link
Contributor

@shahar1 shahar1 left a 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!

@suii2210
Copy link
Contributor Author

suii2210 commented Jan 26, 2026

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 .

figure-1 : azure-ad-authentication.png
Azure AD app registration authentication settings

Example Azure AD app registration authentication settings showing the redirect URI
configured for Airflow OAuth.

figure - 2 : azure-ad-token-claims.png
Azure AD token configuration with group or role claims enabled

Example Azure AD token configuration enabling group or role claims for RBAC mapping.
azure-ad-authentication
azure-ad-token-claims

@shahar1
Copy link
Contributor

shahar1 commented Jan 26, 2026

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 .

figure-1 : azure-ad-authentication.png
Azure AD app registration authentication settings

Example Azure AD app registration authentication settings showing the redirect URI
configured for Airflow OAuth.

figure - 2 : azure-ad-token-claims.png
Azure AD token configuration with group or role claims enabled

Example Azure AD token configuration enabling group or role claims for RBAC mapping.
azure-ad-authentication
azure-ad-token-claims

Thanks! Could you please add them to the instructions (including all the details) and I'll merge?

@suii2210
Copy link
Contributor Author

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 .
figure-1 : azure-ad-authentication.png
Azure AD app registration authentication settings
Example Azure AD app registration authentication settings showing the redirect URI
configured for Airflow OAuth.
figure - 2 : azure-ad-token-claims.png
Azure AD token configuration with group or role claims enabled
Example Azure AD token configuration enabling group or role claims for RBAC mapping.
azure-ad-authentication
azure-ad-token-claims

Thanks! Could you please add them to the instructions (including all the details) and I'll merge?

Sure, added
Thanks !

@suii2210 suii2210 force-pushed the doc/azure-ad-webserver-auth-example branch from 36aa6db to d0ffd7f Compare January 26, 2026 12:42
@shahar1 shahar1 merged commit 15d2dbb into apache:main Jan 26, 2026
71 checks passed
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add advanced Azure AD OAuth/Webserver authentication example with role/group mapping

4 participants