Search in sources :

Example 6 with SingleSignOnEntry

use of org.apache.catalina.authenticator.SingleSignOnEntry in project tomcat70 by apache.

the class ClusterSingleSignOn method startInternal.

// ------------------------------------------------------- Lifecycle Methods
/**
 * Start this component and implement the requirements
 * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
@Override
protected synchronized void startInternal() throws LifecycleException {
    // Load the cluster component, if any
    try {
        if (cluster == null) {
            Container host = getContainer();
            if (host instanceof Host) {
                if (host.getCluster() instanceof CatalinaCluster) {
                    setCluster((CatalinaCluster) host.getCluster());
                }
            }
        }
        if (cluster == null) {
            throw new LifecycleException("There is no Cluster for ClusterSingleSignOn");
        }
        ClassLoader[] cls = new ClassLoader[] { this.getClass().getClassLoader() };
        ReplicatedMap<String, SingleSignOnEntry> cache = new ReplicatedMap<String, SingleSignOnEntry>(this, cluster.getChannel(), rpcTimeout, cluster.getClusterName() + "-SSO-cache", cls, terminateOnStartFailure);
        cache.setChannelSendOptions(mapSendOptions);
        cache.setAccessTimeout(accessTimeout);
        this.cache = cache;
    } catch (Throwable t) {
        ExceptionUtils.handleThrowable(t);
        throw new LifecycleException("ClusterSingleSignOn exception during clusterLoad " + t);
    }
    super.startInternal();
}
Also used : Container(org.apache.catalina.Container) LifecycleException(org.apache.catalina.LifecycleException) CatalinaCluster(org.apache.catalina.ha.CatalinaCluster) SingleSignOnEntry(org.apache.catalina.authenticator.SingleSignOnEntry) Host(org.apache.catalina.Host) ReplicatedMap(org.apache.catalina.tribes.tipis.ReplicatedMap)

Example 7 with SingleSignOnEntry

use of org.apache.catalina.authenticator.SingleSignOnEntry in project Payara by payara.

the class GlassFishSingleSignOn method deregister.

// -------------------------------------------------------- Package Methods
/**
 * Deregister the specified single sign on identifier, and invalidate any associated sessions.
 *
 * @param ssoId Single sign on identifier to deregister
 */
protected void deregister(String ssoId) {
    // S1AS8 6155481 START
    if (logger.isLoggable(Level.FINE)) {
        logger.log(Level.FINE, LogFacade.DEREGISTER_SSO);
    }
    // S1AS8 6155481 END
    // Look up and remove the corresponding SingleSignOnEntry
    final SingleSignOnEntry sso = this.cache.remove(ssoId);
    if (sso == null) {
        return;
    }
    // Expire any associated sessions
    sso.expireSessions();
// NOTE: Clients may still possess the old single sign on cookie,
// but it will be removed on the next request since it is no longer
// in the cache
}
Also used : SingleSignOnEntry(org.apache.catalina.authenticator.SingleSignOnEntry)

Example 8 with SingleSignOnEntry

use of org.apache.catalina.authenticator.SingleSignOnEntry in project Payara by payara.

the class GlassFishSingleSignOn method removeSession.

/**
 * 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) {
    if (logger.isLoggable(Level.FINE)) {
        logger.log(Level.FINE, LogFacade.REMOVE_SESSION_FROM_SSO, new Object[] { session.toString(), ssoId });
    }
    // Get a reference to the SingleSignOn
    SingleSignOnEntry entry = lookup(ssoId);
    if (entry == null)
        return;
    // Remove the inactive session from SingleSignOnEntry
    entry.removeSession(session);
    // deregister the entry.
    if (entry.isEmpty()) {
        deregister(ssoId);
    }
}
Also used : SingleSignOnEntry(org.apache.catalina.authenticator.SingleSignOnEntry)

Aggregations

SingleSignOnEntry (org.apache.catalina.authenticator.SingleSignOnEntry)8 Container (org.apache.catalina.Container)2 Host (org.apache.catalina.Host)2 LifecycleException (org.apache.catalina.LifecycleException)2 CatalinaCluster (org.apache.catalina.ha.CatalinaCluster)2 ReplicatedMap (org.apache.catalina.tribes.tipis.ReplicatedMap)2 BackingStoreException (org.glassfish.ha.store.api.BackingStoreException)2 ArrayList (java.util.ArrayList)1 Cookie (javax.servlet.http.Cookie)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 HttpRequest (org.apache.catalina.HttpRequest)1 Realm (org.apache.catalina.Realm)1