예제 #1
0
 @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);
     }
   }
 }
예제 #2
0
 @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);
   }
 }
예제 #3
0
 @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);
       }
     }
   }
 }