Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions airflow/config_templates/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
<https://cloud.google.com/docs/authentication/production#finding_credentials_automatically>`__ 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
Expand Down
2 changes: 2 additions & 0 deletions providers/google/docs/api-auth-backend/google-openid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
Google OpenID authentication
''''''''''''''''''''''''''''

.. note:: This authentication mechanism only works for Airflow 2.x

You can also configure
`Google OpenID <https://developers.google.com/identity/protocols/oauth2/openid-connect>`__
for authentication. To enable it, set the following option in the configuration:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Comment thread
ashb marked this conversation as resolved.


def create_client_session():
Expand All @@ -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."""

Expand Down