diff --git a/airflow/config_templates/config.yml b/airflow/config_templates/config.yml index f29a70216c6cd..36438dec853b1 100644 --- a/airflow/config_templates/config.yml +++ b/airflow/config_templates/config.yml @@ -1391,24 +1391,6 @@ api: example: ~ version_added: 2.0.0 default: "100" - google_oauth2_audience: - description: The intended audience for JWT token credentials used for authorization. - This value must match on the client and server sides. - If empty, audience will not be tested. - type: string - version_added: 2.0.0 - example: project-id-random-value.apps.googleusercontent.com - default: "" - google_key_path: - description: | - Path to Google Cloud Service Account key file (JSON). If omitted, authorization based on - `the Application Default Credentials - `__ will - be used. - type: string - version_added: 2.0.0 - example: /files/service-account-json - default: "" access_control_allow_headers: description: | Used in response to a preflight request to indicate which HTTP diff --git a/providers/google/docs/api-auth-backend/google-openid.rst b/providers/google/docs/api-auth-backend/google-openid.rst index 303e81869d13f..03885876cbea9 100644 --- a/providers/google/docs/api-auth-backend/google-openid.rst +++ b/providers/google/docs/api-auth-backend/google-openid.rst @@ -18,6 +18,8 @@ Google OpenID authentication '''''''''''''''''''''''''''' +.. note:: This authentication mechanism only works for Airflow 2.x + You can also configure `Google OpenID `__ for authentication. To enable it, set the following option in the configuration: diff --git a/providers/google/src/airflow/providers/google/common/auth_backend/google_openid.py b/providers/google/src/airflow/providers/google/common/auth_backend/google_openid.py index 4a3f45fa4a3a8..e18e90af6a8a0 100644 --- a/providers/google/src/airflow/providers/google/common/auth_backend/google_openid.py +++ b/providers/google/src/airflow/providers/google/common/auth_backend/google_openid.py @@ -32,12 +32,16 @@ from google.oauth2 import service_account from airflow.configuration import conf +from airflow.exceptions import AirflowProviderDeprecationWarning +from airflow.providers.google.common.deprecated import deprecated from airflow.providers.google.common.utils.id_token_credentials import get_default_id_token_credentials log = logging.getLogger(__name__) _GOOGLE_ISSUERS = ("accounts.google.com", "https://accounts.google.com") -AUDIENCE = conf.get("api", "google_oauth2_audience") +AUDIENCE = conf.get( + "api", "google_oauth2_audience", fallback="project-id-random-value.apps.googleusercontent.com" +) def create_client_session(): @@ -52,6 +56,11 @@ def create_client_session(): return AuthorizedSession(credentials=id_token_credentials) +@deprecated( + planned_removal_release="apache-airflow-providers-google==15.0.0", + reason="Auth backends are not supported on Airflow 3, and this entire module will be removed", + category=AirflowProviderDeprecationWarning, +) def init_app(_): """Initialize authentication."""