Configuration Reference

This page contains the list of all available Airflow configurations for the apache-airflow-providers-keycloak provider that can be set in the airflow.cfg file or using environment variables.

Note

For more information see Setting Configuration Options.

[keycloak_auth_manager]

This section contains settings for Keycloak auth manager integration.

cache_timeout_seconds

Added in version 0.9.0.

Timeout (in seconds) to cache auth decisions in bulk is_authorized_{resource} methods.

Type:

integer

Default:

60

Environment Variable:

AIRFLOW__KEYCLOAK_AUTH_MANAGER__CACHE_TIMEOUT_SECONDS

cache_ttl_seconds

Added in version 0.9.0.

Time (in seconds) to cache auth decisions in bulk is_authorized_{resource} methods.

Type:

integer

Default:

30

Environment Variable:

AIRFLOW__KEYCLOAK_AUTH_MANAGER__CACHE_TTL_SECONDS

client_id

Added in version 0.0.1.

Client ID configured in Keycloak to integrate with Airflow. This client must follow the standard OpenID Connect authentication flow.

Type:

string

Default:

None

Environment Variable:

AIRFLOW__KEYCLOAK_AUTH_MANAGER__CLIENT_ID

client_secret

Added in version 0.0.1.

Secret associated to the client configured in Keycloak to integrate with Airflow.

Type:

string

Default:

None

Environment Variables:

AIRFLOW__KEYCLOAK_AUTH_MANAGER__CLIENT_SECRET

AIRFLOW__KEYCLOAK_AUTH_MANAGER__CLIENT_SECRET_CMD

AIRFLOW__KEYCLOAK_AUTH_MANAGER__CLIENT_SECRET_SECRET

jwt_federated_client_ids

Added in version 0.10.0.

Comma-separated allow-list of Keycloak client ids (azp claim) permitted to exchange a Keycloak-issued access token for an Airflow token via the urn:ietf:params:oauth:grant-type:jwt-bearer grant at /auth/token. Unset or empty denies every caller.

Type:

string

Default:

None

Environment Variable:

AIRFLOW__KEYCLOAK_AUTH_MANAGER__JWT_FEDERATED_CLIENT_IDS

Example:

team-platform-admin-sa,other-team-sa

realm

Added in version 0.0.1.

Realm configured in Keycloak associated to Airflow. This realm define all users, roles and groups used in Airflow.

Type:

string

Default:

None

Environment Variable:

AIRFLOW__KEYCLOAK_AUTH_MANAGER__REALM

requests_pool_size

Added in version 0.4.0.

Size of the connection pool used by the Keycloak auth manager. This setting improves performance when multiple requests are made to Keycloak server.

Type:

integer

Default:

10

Environment Variable:

AIRFLOW__KEYCLOAK_AUTH_MANAGER__REQUESTS_POOL_SIZE

Example:

10

requests_retries

Added in version 0.4.0.

Number of retries for failed requests made by the Keycloak auth manager. This setting helps to handle transient network issues.

Type:

integer

Default:

3

Environment Variable:

AIRFLOW__KEYCLOAK_AUTH_MANAGER__REQUESTS_RETRIES

Example:

3

server_url

Added in version 0.0.1.

Keycloak server URL. This server URL is used by the Airflow API server to communicate with Keycloak. If the Airflow API server and Keycloak are running in Docker, set “http://host.docker.internal:<PORT>” (default value).

Type:

string

Default:

http://host.docker.internal:48080

Environment Variable:

AIRFLOW__KEYCLOAK_AUTH_MANAGER__SERVER_URL

team_level_authorization

Added in version 0.13.0.

Whether one authorization decision holds for every resource of a type within a team. By default the auth manager asks Keycloak once per Dag, asset, connection, pool or variable when listing them, because a Keycloak policy can read the id of the resource. When no policy of the realm does, set this to True: the auth manager then asks once per team (once in total for assets, and for every type when multi-team is disabled) and applies the answer to all resources of that type. Do not enable it when a policy grants access per resource.

Type:

boolean

Default:

False

Environment Variable:

AIRFLOW__KEYCLOAK_AUTH_MANAGER__TEAM_LEVEL_AUTHORIZATION

Was this entry helpful?