diff --git a/airflow/providers/fab/auth_manager/security_manager/override.py b/airflow/providers/fab/auth_manager/security_manager/override.py index f821c35fbfb58..e617b8e84687c 100644 --- a/airflow/providers/fab/auth_manager/security_manager/override.py +++ b/airflow/providers/fab/auth_manager/security_manager/override.py @@ -2229,13 +2229,17 @@ def get_oauth_user_info(self, provider: str, resp: dict[str, Any]) -> dict[str, me = self.oauth_remotes[provider].get("userinfo") data = me.json() log.debug("User info from Okta: %s", data) - return { - "username": f"{provider}_{data['sub']}", - "first_name": data.get("given_name", ""), - "last_name": data.get("family_name", ""), - "email": data["email"], - "role_keys": data.get("groups", []), - } + if "error" not in data: + return { + "username": f"{provider}_{data['sub']}", + "first_name": data.get("given_name", ""), + "last_name": data.get("family_name", ""), + "email": data["email"], + "role_keys": data.get("groups", []), + } + else: + log.error(data.get("error_description")) + return {} # for Auth0 if provider == "auth0": data = self.appbuilder.sm.oauth_remotes[provider].userinfo() @@ -2258,8 +2262,8 @@ def get_oauth_user_info(self, provider: str, resp: dict[str, Any]) -> dict[str, "first_name": data.get("given_name", ""), "last_name": data.get("family_name", ""), "email": data.get("email", ""), + "role_keys": data.get("groups", []), } - # for Authentik if provider == "authentik": id_token = resp["id_token"] diff --git a/airflow/providers/fab/provider.yaml b/airflow/providers/fab/provider.yaml index a2d6610f80958..b787f810e343a 100644 --- a/airflow/providers/fab/provider.yaml +++ b/airflow/providers/fab/provider.yaml @@ -48,7 +48,7 @@ dependencies: # Every time we update FAB version here, please make sure that you review the classes and models in # `airflow/providers/fab/auth_manager/security_manager/override.py` with their upstream counterparts. # In particular, make sure any breaking changes, for example any new methods, are accounted for. - - flask-appbuilder==4.4.1 + - flask-appbuilder==4.5.0 - flask-login>=0.6.2 - google-re2>=1.0 - jmespath diff --git a/dev/breeze/tests/test_packages.py b/dev/breeze/tests/test_packages.py index 360183a25c386..1eb2957d4d8c4 100644 --- a/dev/breeze/tests/test_packages.py +++ b/dev/breeze/tests/test_packages.py @@ -166,7 +166,7 @@ def test_get_documentation_package_path(): "", """ "apache-airflow>=2.9.0", - "flask-appbuilder==4.4.1", + "flask-appbuilder==4.5.0", "flask-login>=0.6.2", "flask>=2.2,<2.3", "google-re2>=1.0", @@ -179,7 +179,7 @@ def test_get_documentation_package_path(): "dev0", """ "apache-airflow>=2.9.0.dev0", - "flask-appbuilder==4.4.1", + "flask-appbuilder==4.5.0", "flask-login>=0.6.2", "flask>=2.2,<2.3", "google-re2>=1.0", @@ -192,7 +192,7 @@ def test_get_documentation_package_path(): "beta0", """ "apache-airflow>=2.9.0b0", - "flask-appbuilder==4.4.1", + "flask-appbuilder==4.5.0", "flask-login>=0.6.2", "flask>=2.2,<2.3", "google-re2>=1.0", diff --git a/generated/provider_dependencies.json b/generated/provider_dependencies.json index 1e0e5dff2f4cb..bb5d0778fbf2e 100644 --- a/generated/provider_dependencies.json +++ b/generated/provider_dependencies.json @@ -520,7 +520,7 @@ "fab": { "deps": [ "apache-airflow>=2.9.0", - "flask-appbuilder==4.4.1", + "flask-appbuilder==4.5.0", "flask-login>=0.6.2", "flask>=2.2,<2.3", "google-re2>=1.0", diff --git a/scripts/in_container/run_generate_constraints.py b/scripts/in_container/run_generate_constraints.py index 766414187d775..1721279cb4c37 100755 --- a/scripts/in_container/run_generate_constraints.py +++ b/scripts/in_container/run_generate_constraints.py @@ -384,7 +384,6 @@ def generate_constraints_pypi_providers(config_params: ConfigParams) -> None: run_command( cmd=[ *config_params.get_install_command, - "-e", ".[all-core]", *packages_to_install, *config_params.eager_upgrade_additional_requirements_list,