Skip to content

Commit

Permalink
keycloak: do not invalidate session without refresh_token
Browse files Browse the repository at this point in the history
if there are multiple sessions for the same user (i.e. with different
scopes) we only get the refresh_token for the first established one and
we cannot invalidate it on first logout, so let's keep keycloak session
active until the one that established it first logs out
  • Loading branch information
michalskrivanek committed Oct 5, 2022
1 parent 7b26899 commit 28a45b1
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ public static void cleanupSsoSession(
}
}
if (ssoContext.getSsoLocalConfig().getBoolean("ENGINE_SSO_ENABLE_EXTERNAL_SSO")) {
log.debug("Existing Session found for token: {}, invalidating session on external OP",
ssoSession.getAccessToken());
ExternalOIDCService.logout(ssoContext, refreshToken);
log.debug("invalidating session on external OP, refreshToken: {}", refreshToken);
if (refreshToken != null) {
ExternalOIDCService.logout(ssoContext, refreshToken);
}
}
invokeAuthnLogout(ssoContext, ssoSession);
SsoService.notifyClientsOfLogoutEvent(ssoContext,
Expand Down

0 comments on commit 28a45b1

Please sign in to comment.