-
Notifications
You must be signed in to change notification settings - Fork 16.6k
Closed
Labels
area:autharea:corekind:bugThis is a clearly a bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yetlabel for new issues that we didn't triage yetprovider:fab
Description
Apache Airflow version
3.1.7
If "Other Airflow 3 version" selected, which one?
No response
What happened?
When installing the apache-airflow-fab-provider v3.3.0, the OAuth login flow doesn't work. Attached video:
Grabacion.de.pantalla.2026-02-16.a.las.16.30.14.mov
API Server logs:
Error on OAuth authorize: Could not build url for endpoint 'CustomAuthOAuthView.oauth_authorized' with values ['provider']. Did you mean 'CustomAuthOAuthView.logout' instead?
2026-02-16T15:30:18.059766Z [error ] Error on OAuth authorize: Could not build url for endpoint 'CustomAuthOAuthView.oauth_authorized' with values ['provider']. Did you mean 'CustomAuthOAuthView.logout' instead? [flask_appbuilder.security.views] loc=views.py:670
It worked in the previous version that I had installed (3.1.1)
What you think should happen instead?
Login should work
How to reproduce
- Install Airflow 3.1.7 and apache-airflow-providers-fab==3.3.0
- Set the following
webserver_config.py
from typing import Any
from airflow.providers.fab.auth_manager.security_manager.override import FabAirflowSecurityManagerOverride
from flask_appbuilder.security.manager import AUTH_OAUTH
import os
AUTH_TYPE = AUTH_OAUTH
AUTH_USER_REGISTRATION = True
AUTH_USER_REGISTRATION_ROLE = os.environ["AIRFLOW_WEBSERVER_USER_REGISTRATION_ROLE"]
PERMANENT_SESSION_LIFETIME = 1800
OAUTH_PROVIDERS = [
{
"name": "github",
"icon": "fa-github",
"token_key": "access_token",
"remote_app": {
"client_id": os.getenv("GITHUB_OAUTH_APP_ID"),
"client_secret": os.getenv("GITHUB_OAUTH_APP_SECRET"),
"api_base_url": "https://api.github.com",
"client_kwargs": {"scope": "read:user, read:org"},
"access_token_url": "https://github.com/login/oauth/access_token",
"authorize_url": "https://github.com/login/oauth/authorize",
"request_token_url": None,
},
},
]
class GithubAuthorizer(FabAirflowSecurityManagerOverride):
def get_oauth_user_info(self, provider: str, resp: Any) -> dict[str, str | list[str]]:
remote_app = self.appbuilder.sm.oauth_remotes[provider]
me = remote_app.get("user")
user_data = me.json()
username = user_data["login"]
try:
name_surname_list = user_data["name"].split(" ", 1)
first_name = name_surname_list[0]
last_name = name_surname_list[1]
except Exception:
first_name = last_name = "unknown"
return {
"username": username,
"email": user_data["email"],
"first_name": first_name,
"last_name": last_name,
}
SECURITY_MANAGER_CLASS = GithubAuthorizer- Try to log in
Operating System
airflow in docker
Versions of Apache Airflow Providers
No response
Deployment
Official Apache Airflow Helm Chart
Deployment details
No response
Anything else?
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:autharea:corekind:bugThis is a clearly a bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yetlabel for new issues that we didn't triage yetprovider:fab