You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "suii2210 (via GitHub)" <gi...@apache.org> on 2026/01/18 20:14:34 UTC

[PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

suii2210 opened a new pull request, #60756:
URL: https://github.com/apache/airflow/pull/60756

   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.
   
   Docs-only change.
   Fixes #60748
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

Posted by "suii2210 (via GitHub)" <gi...@apache.org>.
suii2210 commented on PR #60756:
URL: https://github.com/apache/airflow/pull/60756#issuecomment-3767401008

   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

Posted by "suii2210 (via GitHub)" <gi...@apache.org>.
suii2210 commented on PR #60756:
URL: https://github.com/apache/airflow/pull/60756#issuecomment-3775165363

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

Posted by "suii2210 (via GitHub)" <gi...@apache.org>.
suii2210 commented on PR #60756:
URL: https://github.com/apache/airflow/pull/60756#issuecomment-3798225057

   > 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:: /img/azure-ad-authentication.png
      :alt: Azure AD app registration authentication settings
   
      Example Azure AD app registration authentication settings showing the redirect URI
      configured for Airflow OAuth.
   
   .. figure:: /img/azure-ad-token-claims.png
      :alt: 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](https://github.com/user-attachments/assets/00a15468-6e2c-4ff2-b567-bdd53c370d6a)
   ![azure-ad-token-claims](https://github.com/user-attachments/assets/f24ee691-b282-4f85-8858-722b586bbcec)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 merged PR #60756:
URL: https://github.com/apache/airflow/pull/60756


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

Posted by "suii2210 (via GitHub)" <gi...@apache.org>.
suii2210 commented on PR #60756:
URL: https://github.com/apache/airflow/pull/60756#issuecomment-3767250839

   > Hey Shruti,
   > 
   > I'd kindly suggest to read and adhere to the [guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

Posted by "suii2210 (via GitHub)" <gi...@apache.org>.
suii2210 commented on PR #60756:
URL: https://github.com/apache/airflow/pull/60756#issuecomment-3796549828

   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #60756:
URL: https://github.com/apache/airflow/pull/60756#discussion_r2728014080


##########
docs/spelling_wordlist.txt:
##########
@@ -620,6 +620,7 @@ encryptor
 enqueue
 enqueued
 Entra
+entra

Review Comment:
   You do not use this word, I dont think you need to add it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 commented on PR #60756:
URL: https://github.com/apache/airflow/pull/60756#issuecomment-3767363966

   > > Hey Shruti,
   > > 
   > > I'd kindly suggest to read and adhere to the [guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) 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?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on PR #60756:
URL: https://github.com/apache/airflow/pull/60756#issuecomment-3768646894

   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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 commented on PR #60756:
URL: https://github.com/apache/airflow/pull/60756#issuecomment-3798752269

   > > 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](https://github.com/user-attachments/assets/00a15468-6e2c-4ff2-b567-bdd53c370d6a)
   > ![azure-ad-token-claims](https://github.com/user-attachments/assets/f24ee691-b282-4f85-8858-722b586bbcec)
   > 
   
   Thanks! Could you please add them to the instructions (including all the details) and I'll merge?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

Posted by "suii2210 (via GitHub)" <gi...@apache.org>.
suii2210 commented on PR #60756:
URL: https://github.com/apache/airflow/pull/60756#issuecomment-3799043017

   > > > 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](https://private-user-images.githubusercontent.com/176028067/540389048-00a15468-6e2c-4ff2-b567-bdd53c370d6a.jpeg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Njk0MjU2NDQsIm5iZiI6MTc2OTQyNTM0NCwicGF0aCI6Ii8xNzYwMjgwNjcvNTQwMzg5MDQ4LTAwYTE1NDY4LTZlMmMtNGZmMi1iNTY3LWJkZDUzYzM3MGQ2YS5qcGVnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDEyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAxMjZUMTEwMjI0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjAyNjNhZWU4NjhkNDYxNzNkNzQwM2YzZjc1OWQ3MjYzZWI2N2Y3MGExYTQzNmIxM2YxMWM2YWVlZGJlNmU2MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.ciJrwxgk6Ggu30mns8Aqox5eRAWteGSnyowpnrOuauE)
   > > ![azure-ad-token-claims](https://private-user-images.githubusercontent.com/176028067/540389069-f24ee691-b282-4f85-8858-722b586bbcec.jpeg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Njk0MjU2NDQsIm5iZiI6MTc2OTQyNTM0NCwicGF0aCI6Ii8xNzYwMjgwNjcvNTQwMzg5MDY5LWYyNGVlNjkxLWIyODItNGY4NS04ODU4LTcyMmI1ODZiYmNlYy5qcGVnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDEyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAxMjZUMTEwMjI0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NWIyMDcxNTBhYzVlYmU4ZmQ2MjQ4Y2IxMzk5YjJlMDliYTVmYmZhZGMxMjFjOTVmYmUwOTQzZDJhNzE1MDFkNCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.A9jcFEMKYQ2cfcTU5-5F4sW5qxgoOLfEKE4zy-YfU0I)
   > 
   > Thanks! Could you please add them to the instructions (including all the details) and I'll merge?
   
   Sure, added 
   Thanks !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add Azure AD OAuth webserver authentication example with role mapping [airflow]

Posted by "suii2210 (via GitHub)" <gi...@apache.org>.
suii2210 commented on code in PR #60756:
URL: https://github.com/apache/airflow/pull/60756#discussion_r2728222787


##########
docs/spelling_wordlist.txt:
##########
@@ -620,6 +620,7 @@ encryptor
 enqueue
 enqueued
 Entra
+entra

Review Comment:
   I’ve removed the “Entra” reference and updated the documentation to consistently use “Azure AD / Azure Active Directory” instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org