/** * Associate the specified single sign on identifier with the * specified Session. * * @param ssoId Single sign on identifier * @param session Session to be associated */ protected void associate(String ssoId, Session session) { if (sso == null) return; sso.associate(ssoId, session); }
protected void deregisterLocal(String ssoId, Session session) { super.deregister(ssoId, session); }
protected void registerLocal(String ssoId, Principal principal, String authType, String username, String password) { super.register(ssoId, principal, authType, username, password); }
String ssoDomain = sso.getCookieDomain(); if(ssoDomain != null) { cookie.setDomain(ssoDomain); sso.register(ssoId, principal, authType, username, password); request.setNote(Constants.REQ_SSOID_NOTE, ssoId); sso.update(ssoId, principal, authType, username, password); sso.associate(ssoId, session);
containerLog.debug(" Principal '" + request.getUserPrincipal().getName() + "' has already been authenticated"); getNext().invoke(request, response); return; if (containerLog.isDebugEnabled()) containerLog.debug(" SSO cookie is not present"); getNext().invoke(request, response); return; SingleSignOnEntry entry = lookup(cookie.getValue()); if (entry != null) { if (containerLog.isDebugEnabled()) request.setNote(Constants.REQ_SSOID_NOTE, cookie.getValue()); if (!getRequireReauthentication()) { request.setAuthType(entry.getAuthType()); request.setUserPrincipal(entry.getPrincipal()); getNext().invoke(request, response);
session.getMaxInactiveInterval() * 1000)) || (Session.SESSION_PASSIVATED_EVENT.equals(event.getType()))) { removeSession(ssoId, session); } else { deregister(ssoId);
/** * Remove a single Session from a SingleSignOn. Called when * a session is timed out and no longer active. * * @param ssoId Single sign on identifier from which to remove the session. * @param session the session to be removed. */ protected void removeSession(String ssoId, Session session) { // Get a reference to the SingleSignOn SingleSignOnEntry entry = lookup(ssoId); if (entry == null) return; // Remove the inactive session from SingleSignOnEntry entry.removeSession(session); // Remove the inactive session from the 'reverse' Map. synchronized(reverse) { reverse.remove(session); } // If there are not sessions left in the SingleSignOnEntry, // deregister the entry. if (entry.findSessions().length == 0) { deregister(ssoId); } }
public void sessionEvent(SessionEvent event) { if (!getState().isAvailable()) { return; || (Session.SESSION_PASSIVATED_EVENT.equals(event.getType())) || (!session.getManager().getContainer().getState().isAvailable())) { removeSession(ssoId, session); } else { deregister(ssoId);
request.getUserPrincipal().getName())); getNext().invoke(request, response); return; containerLog.debug(sm.getString("singleSignOn.debug.cookieNotFound")); getNext().invoke(request, response); return; if (!getRequireReauthentication()) { request.setAuthType(entry.getAuthType()); request.setUserPrincipal(entry.getPrincipal()); String domain = getCookieDomain(); if (domain != null) { cookie.setDomain(domain); getNext().invoke(request, response);
/** * Look up and return the cached SingleSignOn entry associated with this * sso id value, if there is one; otherwise return <code>null</code>. * * @param ssoId Single sign on identifier to look up * @param ssoVersion Single sign on version to look up */ protected SingleSignOnEntry lookup(String ssoId, long ssoVersion) { return lookup(ssoId); }
/** * Attempts reauthentication to the <code>Realm</code> using * the credentials included in argument <code>entry</code>. * * @param ssoId identifier of SingleSignOn session with which the * caller is associated * @param request the request that needs to be authenticated */ protected boolean reauthenticateFromSSO(String ssoId, Request request) { if (sso == null || ssoId == null) return false; boolean reauthenticated = false; Container parent = getContainer(); if (parent != null) { Realm realm = parent.getRealm(); if (realm != null) { reauthenticated = sso.reauthenticate(ssoId, realm, request); } } if (reauthenticated) { associate(ssoId, request.getSessionInternal(true)); if (log.isDebugEnabled()) { log.debug(" Reauthenticated cached principal '" + request.getUserPrincipal().getName() + "' with auth type '" + request.getAuthType() + "'"); } } return reauthenticated; }
protected void updateLocal(String ssoId, Principal principal, String authType, String username, String password) { super.update(ssoId, principal, authType, username, password); }
/** * Acknowledge the occurrence of the specified event. * * @param event SessionEvent that has occurred */ public void sessionEvent(SessionEvent event) { // We only care about session destroyed events if (!Session.SESSION_DESTROYED_EVENT.equals(event.getType())) return; // Look up the single session id associated with this session (if any) Session session = event.getSession(); if (debug >= 1) { String msg = MessageFormat.format(rb.getString(LogFacade.PROCESS_SESSION_DESTROYED_INFO), session); log(msg); } String ssoId = session.getSsoId(); if (ssoId == null) { return; } deregister(ssoId, session); }
sso.register(value, principal, authType, username, password, realm); if (sso.isVersioningSupported()) { request.setNote(Constants.REQ_SSO_VERSION_NOTE, Long.valueOf(0));
protected void removeSessionLocal(String ssoId, Session session) { super.removeSession(ssoId, session); }
/** * Associate the specified single sign on identifier with the * specified Session. * * @param ssoId Single sign on identifier * @param ssoVersion Single sign on version * @param session Session to be associated */ public void associate(String ssoId, long ssoVersion, Session session) { if (!started) { return; } if (debug >= 1) log(rb.getString(LogFacade.ASSOCIATE_SSO_WITH_SESSION_INFO)); SingleSignOnEntry sso = lookup(ssoId, ssoVersion); if (sso != null) { session.setSsoId(ssoId); session.setSsoVersion(ssoVersion); sso.addSession(this, session); } }
String ssoDomain = sso.getCookieDomain(); if(ssoDomain != null) { cookie.setDomain(ssoDomain); sso.register(ssoId, principal, authType, username, password); request.setNote(Constants.REQ_SSOID_NOTE, ssoId); sso.update(ssoId, principal, authType, username, password); sso.associate(ssoId, session);
getNext().invoke(request, response); return; getNext().invoke(request, response); return; SingleSignOnEntry entry = lookup(cookie.getValue()); if (entry != null) { request.setNote(Constants.REQ_SSOID_NOTE, cookie.getValue()); if (!getRequireReauthentication()) { request.setAuthType(entry.getAuthType()); request.setUserPrincipal(entry.getPrincipal()); getNext().invoke(request, response);
session.getMaxInactiveInterval() * 1000)) || (Session.SESSION_PASSIVATED_EVENT.equals(event.getType()))) { removeSession(ssoId, session); } else { deregister(ssoId);
/** * Remove a single Session from a SingleSignOn. Called when * a session is timed out and no longer active. * * @param ssoId Single sign on identifier from which to remove the session. * @param session the session to be removed. */ protected void removeSession(String ssoId, Session session) { // Get a reference to the SingleSignOn SingleSignOnEntry entry = lookup(ssoId); if (entry == null) return; // Remove the inactive session from SingleSignOnEntry entry.removeSession(session); // Remove the inactive session from the 'reverse' Map. synchronized(reverse) { reverse.remove(session); } // If there are not sessions left in the SingleSignOnEntry, // deregister the entry. if (entry.findSessions().length == 0) { deregister(ssoId); } }