8000 Reject online refresh tokens for sessions in logout states by lhanusov · Pull Request #54753 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Reject online refresh tokens for sessions in logout states - #54753

Merged
mposolda merged 1 commit into
keycloak:mainfrom
lhanusov:fix/refresh-token-validation
Nov 6, 2026
Merged

mposolda merged 1 commit into
keycloak:mainfrom
lhanusov:fix/refresh-token-validation

Conversation

@lhanusov
@lhanusov lhanusov commented Nov 6, 2026
Copy link
Copy Markdown
Contributor

Check user and client session logout state before refreshing tokens, preserving pending logout state and preventing idle timestamp updates. Keep offline and service-account refresh behavior unchanged.

Closes #54484

Check user and client session logout state before refreshing tokens,
preserving pending logout state and preventing idle timestamp updates.
Keep offline and service-account refresh behavior unchanged.

Closes keycloak#54484

Signed-off-by: Lukas Hanusovsky <lhanusov@redhat.com>
@lhanusov
lhanusov requested a review from a team as a code owner November 6, 2026 12:07
Copilot AI balanced review requested due to automatic review settings November 6, 2026 12:07
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for the logout-state refresh-token restrictions.

No open issues 🎉

What changed in this PR

This PR addresses #54484 by rejecting online refresh tokens when the user or client session is in a logout state, including incomplete front-channel logout flows.

Changes:

  • Adds logout-state checks before refresh processing, preserving pending logout state and preventing idle timestamp updates.
  • Adds tests for rejected refreshes, unchanged session state and timestamps, and offline refresh after logout.
  • Documents the online refresh restriction and offline-token exemption.
File Description
tests/​base/​src/​test/​java/​org/​keycloak/​tests/​oauth/​RefreshTokenTest.java Tests logout-state rejection, session preservation, and offline refresh.
services/​src/​main/​java/​org/​keycloak/​protocol/​oidc/​TokenManager.java Rejects online refreshes for user and client sessions in logout states.
docs/​documentation/​server_admin/​topics/​sessions/​offline.adoc Clarifies refresh-token behavior once logout begins.

Review effort: Balanced

@mposolda mposolda left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@lhanusov Thanks!

@mposolda mposolda self-assigned this Nov 6, 2026
@mposolda
mposolda merged commit b1182f9 into keycloak:main Nov 6, 2026
95 of 96 checks passed
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.

Refresh-Token Validation Ignores Logout State

3 participants

0