Hi Airflow community, I'd like to propose adding a new community provider, apache-airflow-providers-microsoft-identity. Its first and, for now, only component is an auth manager for Microsoft AD FS (Active Directory Federation Services).
I work on an Airflow deployment in an organisation that authenticates its internal applications against an on-premises AD FS. Integration overview -------------------- Many organisations still authenticate their internal applications against an on-premises AD FS. With Airflow 3 they have two options today: the FAB auth manager with an OAuth configuration, or the Keycloak auth manager with a Keycloak instance federating to AD FS. The first keeps FAB and its user and role database in the deployment only for login. The second adds an identity service to run and maintain. We currently use the second option, with Keycloak. Following internal changes that allow it, we would like to switch to connecting Airflow to AD FS directly. The proposed AdfsAuthManager talks to AD FS directly: - Login uses the OpenID Connect authorization code flow with PKCE, state and nonce. The API server redeems the code. - The ID token is validated against the AD FS signing keys (RS256 signature, issuer, audience, expiry, nonce). The access token can be validated as well when a Web API resource is configured. Signing key rollover in AD FS needs no action. - Group or role claims issued by AD FS are mapped to four roles (VIEWER, USER, OP, ADMIN) through configuration. - In multi-team mode, claims can map to a role per team. - Claims can also grant a role on specific Dags, connections, variables or pools, selected by ID or pattern. Grants only add access. - Roles are resolved once, at login, and stored in the Airflow token. Authorization checks are done in memory and never call AD FS. - Logout ends the AD FS session too. On Airflow 3.2+ it also revokes the Airflow token. - No AD FS token is kept after login, except the ID token, which is kept in a cookie to be sent as id_token_hint at logout. - TLS verification of the connections to AD FS cannot be disabled; a CA bundle can be configured for internal certificate authorities. The provider requires Airflow 3.0 or later and AD FS on Windows Server 2016 or later. It depends only on pyjwt[crypto], requests and the common.compat provider. It has no dependency on FAB or Flask. It follows the structure of the Keycloak auth manager. Scope and non-goals ------------------- - Only AD FS is covered. Entra ID is not. - There is no user or role management UI. Roles and grants are defined in the Airflow configuration and group membership in Active Directory. - A change of group membership applies at the next login, or when the Airflow token expires. - There is no endpoint yet to exchange AD FS credentials or tokens for an Airflow API token. - No hooks, operators or connection types. Naming ------ I named the provider microsoft.identity rather than microsoft.adfs, so that an Entra ID auth manager could be added to it later without renaming a released package. Nobody has started that work. The class is AdfsAuthManager and the configuration section is [adfs_auth_manager]. I would like the list's opinion on this choice. The alternatives I see are a narrower microsoft.adfs provider, or putting the auth manager in the existing microsoft.azure provider, which I did not do because AD FS is not an Azure service and that provider has a much larger dependency set. Testing ------- We would work as the Keycloak provider does: unit tests in Airflow's CI, and manual validation against a real server. - The unit tests cover the OIDC flow, token validation, role resolution, grants and the login and logout routes against locally generated keys and tokens. [STATUS: 891 of 892 unit tests pass on the branch rebased on main of 2026-11-30; fix test_get_fastapi_app for the newer FastAPI before sending, then state that they pass.] - There are no system tests, as for Keycloak. - The one difference is manual testing. Keycloak has a breeze integration that starts a local instance. AD FS cannot have one: it is a Windows Server role that needs an Active Directory domain, and there is no container image for it. The stewards will validate against a real AD FS before each release candidate vote. The documentation includes the PowerShell commands to register Airflow in a lab farm. For this proposal I validated it on one of our test instances (Airflow 3.4.0, multi-team mode with three teams) against a lab AD FS farm on Windows Server 2022, with a public client and PKCE: login, role and team mapping, denial of a user without a mapped group, logout, and isolation between teams for Dags, variables, connections and pools. Proposed stewards ----------------- - Mathieu Monet (stegololz) - David Blain (dabla) Sponsoring committer(s) ----------------------- - David Blain (dabla) Working implementation ---------------------- Branch feature/microsoft-adfs-auth-manager on my fork: https://github.com/stegololz/airflow/tree/feature/microsoft-adfs-auth-manager It contains the provider (about 1,700 lines), unit tests (about 3,400 lines) and documentation: AD FS registration with PowerShell examples, configuration, permissions and security notes. The provider is marked not-ready and in incubation. I have not opened a PR yet and will do so once this discussion concludes. Incubation commitment --------------------- We commit to: - maintaining the provider and responding to issues within a reasonable time; - meeting the incubation health metrics within 6 months; - participating in quarterly governance updates. One remark on the metrics: an auth manager for a single identity product will probably see fewer issues and PRs than an integration with many operators. I will report the numbers as they are in the quarterly updates. What I am asking ---------------- - Feedback on whether this belongs in the community providers, and on the design. - An opinion on the package name. - Reviewers familiar with the auth manager interface, and anyone else who runs Airflow against AD FS and wants to help maintain the provider. - Confirmation that, as described in ACCEPTING_PROVIDERS.rst, no vote is needed and I can open the PR if there are no objections after 7 days. If you run Airflow against AD FS and want to test the branch, I would be glad to hear how it goes. Best regards, Mathieu Monet --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
