@Override public void logoutBySsoId(List<String> ssoIds) { SamlSession account = getAccount(); for (String ssoId : ssoIds) { if (account != null && account.getSessionIndex().equals(ssoId)) { logoutAccount(); } else if (idMapper != null) { String sessionId = idMapper.getSessionFromSSO(ssoId); idMapper.removeSession(sessionId); } } }
@Override public void logoutAccount() { HttpSession session = request.getSession(false); if (session == null) return; if (session != null) { if (idMapper != null) idMapper.removeSession(session.getId()); SamlSession samlSession = (SamlSession) session.getAttribute(SamlSession.class.getName()); if (samlSession != null) { session.removeAttribute(SamlSession.class.getName()); } clearSavedRequest(session); } }
@Override public void logoutByPrincipal(String principal) { SamlSession account = getAccount(); if (account != null && account.getPrincipal().getSamlSubject().equals(principal)) { logoutAccount(); } if (idMapper != null) { Set<String> sessions = idMapper.getUserSessions(principal); if (sessions != null) { List<String> ids = new LinkedList<String>(); ids.addAll(sessions); for (String id : ids) { idMapper.removeSession(id); } } } }