Skip to content

Commit

Permalink
Keycloak: Account for millisecond truncation of action-token expirati…
Browse files Browse the repository at this point in the history
…on marker in SessionPropagationActionTokenHandler
  • Loading branch information
thomasdarimont committed Dec 11, 2023
1 parent 598c4f5 commit 5206be7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public Response handleToken(SessionPropagationActionToken token, ActionTokenCont

// mark token as consumed
var singleUseObjectProvider = session.getProvider(SingleUseObjectProvider.class);
singleUseObjectProvider.put(token.serializeKey(), token.getExp() - Time.currentTime(), null); // Token is invalidated
singleUseObjectProvider.put(token.serializeKey(), token.getExp() - Time.currentTime() + 1, null); // mark token as invalidated, +1 second to account for rounding to seconds

var authSession = tokenContext.getAuthenticationSession();
var authenticatedUser = authSession.getAuthenticatedUser();
Expand Down

0 comments on commit 5206be7

Please sign in to comment.