Skip to content

Keycloak provider login fails if access token is too large because of cookie size limit #61771

@exolightor

Description

@exolightor

Apache Airflow Provider(s)

keycloak

Versions of Apache Airflow Providers

apache-airflow-providers-keycloak==0.4.1

Apache Airflow version

3.1.5

Operating System

Ubuntu 22.04.1 LT

Deployment

Virtualenv installation

Deployment details

Packages airflow-core and apache-airflow-providers-keycloak installed via pip in virtualenv. Keycloak config is pointing to Keycloak instance deployed on OpenShift. The Keycloak access token is quite large because multiple realm roles are included in access token.

What happened

After logging in via Keycloak SSO the Airflow UI enters into a 401 unauthorized loop. After successfull auth code flow, the cookie with access token + refresh token is not passed to Airflow UI because they exceed the cookie size limit of 4KB.

Image

What you think should happen instead

After Keycloak login, the Airflow home page should display without any 401 unauthorized errors.

How to reproduce

Login with a Keycloak user having a large access token, e.g., a user with 15+ roles, so that access token + refresh token exceed cookie size limit of 4kB.

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions