diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java index f73227f287..139683abc2 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java @@ -66,7 +66,7 @@ public class ServletRequestAuthenticator extends UndertowRequestAuthenticator { HttpServletRequest req = (HttpServletRequest) servletRequestContext.getServletRequest(); HttpSession session = req.getSession(true); session.setAttribute(KeycloakUndertowAccount.class.getName(), account); - userSessionManagement.login(servletRequestContext.getDeployment().getSessionManager(), session, account.getPrincipal().getName(), account.getKeycloakSecurityContext().getToken().getSessionState()); + userSessionManagement.login(servletRequestContext.getDeployment().getSessionManager(), session.getId(), account.getPrincipal().getName(), account.getKeycloakSecurityContext().getToken().getSessionState()); } } diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowUserSessionManagement.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowUserSessionManagement.java index 1c11d37517..f9df4b05c3 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowUserSessionManagement.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowUserSessionManagement.java @@ -8,7 +8,6 @@ import io.undertow.server.session.SessionManager; import io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler; import org.jboss.logging.Logger; -import javax.servlet.http.HttpSession; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; @@ -62,9 +61,7 @@ public class UndertowUserSessionManagement implements SessionListener { return set; } - public synchronized void login(SessionManager manager, HttpSession session, String username, String keycloakSessionId) { - String sessionId = session.getId(); - + public synchronized void login(SessionManager manager, String sessionId, String username, String keycloakSessionId) { UserSessions sessions = userSessionMap.get(username); if (sessions == null) { sessions = new UserSessions();