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();
}
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
}
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);
}
}
Aggregations