SPSessionListener.java revision 749b4f511c5a0ef831258e3047d69bf04ce78495
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: SPSessionListener.java,v 1.6 2009/09/23 22:28:32 bigfatrat Exp $
*
* Portions Copyrighted 2014-2015 ForgeRock AS.
*/
/**
* The class <code>SPSessionListener</code> implements
* SessionListener interface and is used for maintaining the
* SP session cache.
*/
public class SPSessionListener implements SessionListener {
private static FedMonAgent agent;
private static FedMonSAML2Svc saml2Svc;
static {
try {
sm = new SAML2MetaManager();
} catch (SAML2MetaException sme) {
}
}
/**
* Constructor of <code>SPSessionListener</code>.
*/
this.infoKeyString = infoKeyString;
}
/**
* Callback for SessionListener.
* It is used for cleaning up the SP session cache.
*
* @param session The session object
*/
{
return;
}
try {
} catch (SessionException se) {
return;
}
{
return;
}
if (fedSessionList == null) {
return;
}
try {
if (spEntityID != null &&
spSessionSyncList != null &&
boolean spSessionSyncEnabled =
// session timeout only when Session Sync flag
// is enabled
if (spSessionSyncEnabled) {
"SP Session Synchronization flag " +
"is enabled, initiating SLO to IDP");
}
}
}
} else {
"Unable to retrieve the SP config" +
" data, spConfig is null");
}
}
}
}
} catch (SAML2MetaException sme) {
"SPSessionListener.sessionInvalidated:", sme);
} catch (SAML2Exception se) {
"SPSessionListener.sessionInvalidated:", se);
} catch (SessionException s) {
"IDPSessionListener.sessionInvalidated:", s);
}
synchronized (fedSessionList) {
{
size());
}
}
}
if (fedSessionList.isEmpty()) {
}
}
}
/**
* Performs an SP initiated SLO against the remote IdP using SOAP binding.
*
* @param metaAlias SP meta alias
* @param realm Realm
* @param binding Binding used
* @param nameIdInfoKey the nameIdInfoKey
* @param fedSession SP Federated session
* @param paramsMap parameters map
* @throws SAML2MetaException If there was an error while retrieving the metadata.
* @throws SAML2Exception If there was an error while initiating SLO.
* @throws SessionException If there was a problem with the session.
*/
}
if (debug.warningEnabled()) {
debug.warning("SPSessionListener.initiateSPSingleLogout(): Unable to synchronize sessions with IdP \""
+ "specified in its metadata, possibly this is a misconfiguration of the hosted SP");
}
return;
}
}
}