Skip to content

Commit

Permalink
[DO NOT MERGE] log refresh_token
Browse files Browse the repository at this point in the history
  • Loading branch information
michalskrivanek committed Sep 27, 2022
1 parent ce8b692 commit ff6c36c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ private static SsoSession login(SsoContext ssoContext,
buildAuthRecord(credentials.getUsername()),
buildPrincipalRecord(getUserInfo(ssoContext, accessToken), credentials.getUsername()));

log.debug("LOGOUT refresh_token: {}", (String) response.get("refresh_token"));
if (response.containsKey("refresh_token")) {
ssoSession.setRefreshToken((String) response.get("refresh_token"));
}
Expand Down Expand Up @@ -321,6 +322,7 @@ public static void logout(SsoContext ssoContext, String refreshToken) {
form.add(new BasicNameValuePair("client_id", externalOidcClientId));
form.add(new BasicNameValuePair("client_secret", externalOidcClientSecret));
post.setEntity(new UrlEncodedFormEntity(form, StandardCharsets.UTF_8));
log.debug("LOGOUT refresh_token: {}", refreshToken);

Map<String, Object> response = getResponse(ssoContext, post);
if (response.containsKey("error") && response.containsKey("error_description")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public static void cleanupSsoSession(
try {
ssoContext.removeSsoSession(ssoSession.getAccessToken());
HttpSession existingSession = ssoSession.getHttpSession();
String refreshToken = ssoSession.getRefreshToken();
if (existingSession == null) {
log.debug("No existing Session found for token: {}, cannot invalidate session",
ssoSession.getAccessToken());
Expand All @@ -67,7 +68,7 @@ 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, ssoSession.getRefreshToken());
ExternalOIDCService.logout(ssoContext, refreshToken);
}
invokeAuthnLogout(ssoContext, ssoSession);
SsoService.notifyClientsOfLogoutEvent(ssoContext,
Expand Down

0 comments on commit ff6c36c

Please sign in to comment.