@Override public void handleNotification(SecurityNotification notification) { if (notification.getEventType() == SecurityNotification.EventType.LOGGED_OUT) { singleSignOnManager.removeSingleSignOn(sso); } } });
@Override public void sessionDestroyed(Session session, HttpServerExchange exchange, SessionDestroyedReason reason) { String ssoId = (String) session.getAttribute(SSO_SESSION_ATTRIBUTE); if (ssoId != null) { if(log.isTraceEnabled()) { log.tracef("Removing SSO ID %s from destroyed session %s.", ssoId, session.getId()); } List<Session> sessionsToRemove = new LinkedList<>(); try (SingleSignOn sso = singleSignOnManager.findSingleSignOn(ssoId)) { if (sso != null) { sso.remove(session); if (reason == SessionDestroyedReason.INVALIDATED) { for (Session associatedSession : sso) { sso.remove(associatedSession); sessionsToRemove.add(associatedSession); } } // If there are no more associated sessions, remove the SSO altogether if (!sso.iterator().hasNext()) { singleSignOnManager.removeSingleSignOn(sso); } } } // Any consequential session invalidations will trigger this listener recursively, // so make sure we don't attempt to invalidate session until after the sso is removed. for (Session sessionToRemove : sessionsToRemove) { sessionToRemove.invalidate(null); } } }
@Override public void handleNotification(SecurityNotification notification) { if (notification.getEventType() == SecurityNotification.EventType.LOGGED_OUT) { singleSignOnManager.removeSingleSignOn(sso); } } });
@Override public void handleNotification(SecurityNotification notification) { if (notification.getEventType() == SecurityNotification.EventType.LOGGED_OUT) { singleSignOnManager.removeSingleSignOn(sso); } } });
@Override public void sessionDestroyed(Session session, HttpServerExchange exchange, SessionDestroyedReason reason) { String ssoId = (String) session.getAttribute(SSO_SESSION_ATTRIBUTE); if (ssoId != null) { if(log.isTraceEnabled()) { log.tracef("Removing SSO ID %s from destroyed session %s.", ssoId, session.getId()); } List<Session> sessionsToRemove = new LinkedList<>(); try (SingleSignOn sso = singleSignOnManager.findSingleSignOn(ssoId)) { if (sso != null) { sso.remove(session); if (reason == SessionDestroyedReason.INVALIDATED) { for (Session associatedSession : sso) { sso.remove(associatedSession); sessionsToRemove.add(associatedSession); } } // If there are no more associated sessions, remove the SSO altogether if (!sso.iterator().hasNext()) { singleSignOnManager.removeSingleSignOn(sso); } } } // Any consequential session invalidations will trigger this listener recursively, // so make sure we don't attempt to invalidate session until after the sso is removed. for (Session sessionToRemove : sessionsToRemove) { sessionToRemove.invalidate(null); } } }
@Override public void sessionDestroyed(Session session, HttpServerExchange exchange, SessionDestroyedReason reason) { String ssoId = (String) session.getAttribute(SSO_SESSION_ATTRIBUTE); if (ssoId != null) { if(log.isTraceEnabled()) { log.tracef("Removing SSO ID %s from destroyed session %s.", ssoId, session.getId()); } List<Session> sessionsToRemove = new LinkedList<>(); try (SingleSignOn sso = singleSignOnManager.findSingleSignOn(ssoId)) { if (sso != null) { sso.remove(session); if (reason == SessionDestroyedReason.INVALIDATED) { for (Session associatedSession : sso) { sso.remove(associatedSession); sessionsToRemove.add(associatedSession); } } // If there are no more associated sessions, remove the SSO altogether if (!sso.iterator().hasNext()) { singleSignOnManager.removeSingleSignOn(sso); } } } // Any consequential session invalidations will trigger this listener recursively, // so make sure we don't attempt to invalidate session until after the sso is removed. for (Session sessionToRemove : sessionsToRemove) { sessionToRemove.invalidate(null); } } }