Skip to content

Conversation

@wolfdn
Copy link
Contributor

@wolfdn wolfdn commented Dec 12, 2025

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.

Copy link
Member

@potiuk potiuk left a comment

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
82 checks passed
FoxHelms pushed a commit to FoxHelms/airflow that referenced this pull request Dec 17, 2025
)

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

* Remove login_user function from custom auth manager example
Lohith625 pushed a commit to Lohith625/airflow that referenced this pull request Dec 19, 2025
)

* 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