Search in sources :

Example 21 with SamlSession

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);
}
Also used : HttpSession(javax.servlet.http.HttpSession) ServletRequestContext(io.undertow.servlet.handlers.ServletRequestContext) SamlSession(org.keycloak.adapters.saml.SamlSession)

Example 22 with SamlSession

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() });
    }
}
Also used : SamlSession(org.keycloak.adapters.saml.SamlSession)

Aggregations

SamlSession (org.keycloak.adapters.saml.SamlSession)22 HttpSession (javax.servlet.http.HttpSession)11 HttpScope (org.wildfly.security.http.HttpScope)3 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)2 SamlAuthenticator (org.keycloak.adapters.saml.SamlAuthenticator)2 SamlDeployment (org.keycloak.adapters.saml.SamlDeployment)2 SamlSessionStore (org.keycloak.adapters.saml.SamlSessionStore)2 SamlAuthenticationHandler (org.keycloak.adapters.saml.profile.SamlAuthenticationHandler)2 BrowserHandler (org.keycloak.adapters.saml.profile.webbrowsersso.BrowserHandler)2 SamlEndpoint (org.keycloak.adapters.saml.profile.webbrowsersso.SamlEndpoint)2 AuthChallenge (org.keycloak.adapters.spi.AuthChallenge)2 AuthOutcome (org.keycloak.adapters.spi.AuthOutcome)2 HttpFacade (org.keycloak.adapters.spi.HttpFacade)2 Account (io.undertow.security.idm.Account)1 ServletRequestContext (io.undertow.servlet.handlers.ServletRequestContext)1 IOException (java.io.IOException)1 URI (java.net.URI)1 InvalidKeyException (java.security.InvalidKeyException)1 KeyManagementException (java.security.KeyManagementException)1 SignatureException (java.security.SignatureException)1