8000 Fix flaky RefreshTokenTest.offlineRefreshAfterLogout by ahus1 · Pull Request #55782 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Fix flaky RefreshTokenTest.offlineRefreshAfterLogout - #55782

Draft
ahus1 wants to merge 1 commit into
keycloak:mainfrom
ahus1:flaky-offlineRefreshAfterLogout
Draft

ahus1 wants to merge 1 commit into
keycloak:mainfrom
ahus1:flaky-offlineRefreshAfterLogout

Conversation

@ahus1
@ahus1 ahus1 commented Dec 3, 2026
Copy link
Copy Markdown
Member

Closes #55781

Admin logout sets the user's notBefore to Time.currentTime() (second precision). When token issuance and logout cross a second boundary, the offline token's iat < notBefore, causing a "Stale token" rejection. Shifting time back during the logout call makes notBefore deterministically less than iat.

AI-generated with Claude Code.

Admin logout sets the user's notBefore to Time.currentTime(), which
uses second precision. When token issuance and logout cross a second
boundary, the offline token's iat becomes less than notBefore, causing
a "Stale token" rejection during refresh.

Shift time back by 2 seconds during the logout call so that notBefore
is deterministically before the token's iat.

Closes keycloak#55781

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
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.

Flaky test: RefreshTokenTest.offlineRefreshAfterLogout

1 participant

0