-
Notifications
You must be signed in to change notification settings - Fork 16.6k
Logout the user when the token expires#60781
Conversation
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.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.
|
I think this also covers the "the encryption/signing key has changed" for local development installs, right? |
providers/keycloak/src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py
Outdated
Show resolved
Hide resolved
f60fe20 to
d00ba97
Compare
providers/keycloak/src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py
Outdated
Show resolved
Hide resolved
Yep |
48a3a80 to
ec29c5c
Compare
4cbbcc7 to
ef1bb98
Compare
|
@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 execution api,
|
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 |
bugraoz93
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Vincent!
Ah! that's great! This makes sense |
airflow-core/tests/unit/api_fastapi/auth/middlewares/test_refresh_token.py
Outdated
Show resolved
Hide resolved
ef1bb98 to
e58ab2f
Compare