use of org.keycloak.adapters.saml.SamlSession in project keycloak by keycloak.
the class IdMapperUpdaterSessionListener method map.
private void map(String sessionId, Object value) {
if (!(value instanceof SamlSession) || sessionId == null) {
return;
}
SamlSession account = (SamlSession) value;
idMapper.map(account.getSessionIndex(), account.getPrincipal().getSamlSubject(), sessionId);
}
use of org.keycloak.adapters.saml.SamlSession in project keycloak by keycloak.
the class ElytronSamlSessionStore method logoutAccount.
@Override
public void logoutAccount() {
HttpScope session = getSession(false);
if (session.exists()) {
log.debug("Logging out - current account");
SamlSession samlSession = (SamlSession) session.getAttachment(SamlSession.class.getName());
if (samlSession != null) {
if (samlSession.getSessionIndex() != null) {
idMapperUpdater.removeSession(idMapper, session.getID());
}
session.setAttachment(SamlSession.class.getName(), null);
}
session.setAttachment(SAML_REDIRECT_URI, null);
}
}
use of org.keycloak.adapters.saml.SamlSession in project keycloak by keycloak.
the class ElytronSamlSessionStore method isLoggedIn.
@Override
public boolean isLoggedIn() {
HttpScope session = getSession(false);
if (!session.exists()) {
log.debug("session was null, returning null");
return false;
}
if (!idMapper.hasSession(session.getID()) && !idMapperUpdater.refreshMapping(idMapper, session.getID())) {
log.debugf("Session %s has expired on some other node", session.getID());
session.setAttachment(SamlSession.class.getName(), null);
return false;
}
final SamlSession samlSession = SamlUtil.validateSamlSession(session.getAttachment(SamlSession.class.getName()), deployment);
if (samlSession == null) {
return false;
}
exchange.authenticationComplete(samlSession);
restoreRequest();
return true;
}
use of org.keycloak.adapters.saml.SamlSession in project keycloak by keycloak.
the class ElytronSamlSessionStore method saveAccount.
@Override
public void saveAccount(SamlSession account) {
HttpScope session = getSession(true);
session.setAttachment(SamlSession.class.getName(), account);
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 IdMapperUpdaterSessionListener method map.
private void map(String sessionId, Object value) {
if (!(value instanceof SamlSession) || sessionId == null) {
return;
}
SamlSession account = (SamlSession) value;
idMapper.map(account.getSessionIndex(), account.getPrincipal().getSamlSubject(), sessionId);
}
Aggregations