use of org.keycloak.adapters.saml.SamlSession in project keycloak by keycloak.
the class ServletSamlSessionStore method saveAccount.
@Override
public void saveAccount(SamlSession account) {
final ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
HttpSession session = getSession(true);
session.setAttribute(SamlSession.class.getName(), account);
sessionManagement.login(servletRequestContext.getDeployment().getSessionManager());
String sessionId = changeSessionId(session);
idMapperUpdater.map(idMapper, account.getSessionIndex(), account.getPrincipal().getSamlSubject(), sessionId);
}
use of org.keycloak.adapters.saml.SamlSession in project keycloak by keycloak.
the class SsoCacheSessionIdMapperUpdater method sessionIdChanged.
@Override
public void sessionIdChanged(Session session, String oldSessionId) {
this.httpSessionToSsoCache.remove(oldSessionId);
Object value = session.getAttribute(SamlSession.class.getName());
if (value instanceof SamlSession) {
SamlSession sess = (SamlSession) value;
httpSessionToSsoCache.put(session.getId(), new String[] { sess.getSessionIndex(), sess.getPrincipal().getSamlSubject() });
}
}
Aggregations