Merge pull request #410 from ssilvert/master
Make UndertowUserSessionManagement class usable without the Servlet API.
This commit is contained in:
commit
ab85f09608
2 changed files with 2 additions and 5 deletions
|
@ -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());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue