Skip to content

Adaptions for custom auth manager example in documentation - #59355

Merged
vincbeck merged 3 commits into
apache:mainfrom
boschglobal:feature/allow-skipping-of-session-id-rotation-in-oauth
Dec 16, 2025
Merged

vincbeck merged 3 commits into
apache:mainfrom
boschglobal:feature/allow-skipping-of-session-id-rotation-in-oauth

Conversation

@wolfdn

@wolfdn wolfdn commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

Description

We went through the process to create a custom auth manager for API auth and found some small problems in the example how to create a custom auth manager.
It's required to allow skipping rotate_session_id in auth_user_oauth, because otherwise there will be error messages like this one:

RuntimeError: Working outside of request context.
2025-12-12T07:02:12.688480736Z api-server 
This typically means that you attempted to use functionality that needed
an active HTTP request. Consult the documentation on testing for
information about how to avoid this problem.

The other methods in FabSecurityManagerOverride like auth_user_db and auth_user_ldap also allow this already - we just need to add this also to auth_user_oauth.

Also the login_user function from flask_login needs to be removed from the example in the docs, because calling it results in the same error message.

  • To be clarified with @vincbeck if this is fine

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good @vincbeck ?

@vincbeck
vincbeck merged commit ab5ba5c into apache:main Dec 16, 2025
jhgoebbert pushed a commit to jhgoebbert/airflow_Owen-CH-Leung that referenced this pull request Feb 8, 2026
)

* Allow skipping of session ID rotation when using OAuth in auth manager

* Remove login_user function from custom auth manager example
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.

3 participants