Skip to content

Conversation

@vincbeck
Copy link
Contributor

@vincbeck vincbeck commented Jan 19, 2026

Resolves #59359

There are 2 scenarios:

  • If the Airflow JWT token is expired, then we should log out the user
  • With Keycloak auth manager, if the refresh token is expired, then we should also log out the user.

In both cases, the user as a invalid token and is should no longer be considered as logged-in.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@ashb
Copy link
Member

ashb commented Jan 19, 2026

I think this also covers the "the encryption/signing key has changed" for local development installs, right?

@vincbeck vincbeck force-pushed the vincbeck/keycloak_refresh branch from f60fe20 to d00ba97 Compare January 19, 2026 16:39
@vincbeck
Copy link
Contributor Author

I think this also covers the "the encryption/signing key has changed" for local development installs, right?

Yep

@vincbeck vincbeck force-pushed the vincbeck/keycloak_refresh branch 2 times, most recently from 48a3a80 to ec29c5c Compare January 19, 2026 17:00
@vincbeck vincbeck requested a review from ashb January 19, 2026 17:00
@vincbeck vincbeck force-pushed the vincbeck/keycloak_refresh branch 2 times, most recently from 4cbbcc7 to ef1bb98 Compare January 19, 2026 18:10
@dheerajturaga
Copy link
Member

@vincbeck, what's the lifespan of an jwt token today? One concern here is having users to login very frequently

@bugraoz93
Copy link
Contributor

bugraoz93 commented Jan 19, 2026

@vincbeck, what's the lifespan of an jwt token today? One concern here is having users to login very frequently

It defaults to configuration for both execution and public api have different values. So admins should be able to change according to their security concerns and user behavior
For public api, it is 86400s.


For execution api,

@vincbeck
Copy link
Contributor Author

@vincbeck, what's the lifespan of an jwt token today? One concern here is having users to login very frequently

By default it is one day, but it is a config so you can change it. Note that this PR does not change that. Today, after one day your token is no longer valid. The only difference is today you get alerts all over the UI because you no longer have valid credentials. This PR changes that and logs you out

Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Vincent!

@dheerajturaga
Copy link
Member

@vincbeck, what's the lifespan of an jwt token today? One concern here is having users to login very frequently

By default it is one day, but it is a config so you can change it. Note that this PR does not change that. Today, after one day your token is no longer valid. The only difference is today you get alerts all over the UI because you no longer have valid credentials. This PR changes that and logs you out

Ah! that's great! This makes sense

@vincbeck vincbeck force-pushed the vincbeck/keycloak_refresh branch from ef1bb98 to e58ab2f Compare January 19, 2026 19:10
@dheerajturaga dheerajturaga self-requested a review January 19, 2026 19:12
@vincbeck vincbeck merged commit 9f0099f into apache:main Jan 20, 2026
128 checks passed
@vincbeck vincbeck deleted the vincbeck/keycloak_refresh branch January 20, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal Server Error in Airflow API server with Keycloak provider when token is not active

5 participants