use of com.sun.identity.federation.services.fednsso.FSSSOBrowserPostProfileHandler in project OpenAM by OpenRock.
the class FSServiceManager method getSSOAndFedHandler.
/**
* Returns handler at <code>IDP</code> side that handles single sign on and
* federation requests.
* @param request http request object
* @param response http response object
* @param authnRequest authentication request sent by service provider
* @param realm The realm under which the entity resides.
* @return <code>FSSSOAndFedHandler</code> object
*/
public FSSSOAndFedHandler getSSOAndFedHandler(HttpServletRequest request, HttpServletResponse response, FSAuthnRequest authnRequest, String realm) {
FSUtils.debug.message("FSServiceManager.getSSOAndFedHandler: Called ");
if ((request == null) || (response == null) || (authnRequest == null)) {
FSUtils.debug.error("FSServiceManager.getSSOAndFedHandler: " + FSUtils.bundle.getString("nullInputParameter"));
return null;
}
try {
FSSSOAndFedHandler returnHandler = null;
String profile = authnRequest.getProtocolProfile();
IDFFMetaManager metaManager = FSUtils.getIDFFMetaManager();
String spEntityId = authnRequest.getProviderId();
SPDescriptorType spDescriptor = metaManager.getSPDescriptor(realm, spEntityId);
BaseConfigType spConfig = metaManager.getSPDescriptorConfig(realm, spEntityId);
String relayState = authnRequest.getRelayState();
if (FSUtils.debug.messageEnabled()) {
FSUtils.debug.message("FSServiceManager.getSSOAndFedHandler: requested profile:" + profile);
}
if (profile != null) {
if (profile.equals(IFSConstants.SSO_PROF_BROWSER_ART)) {
returnHandler = new FSSSOBrowserArtifactProfileHandler(request, response, authnRequest, spDescriptor, spConfig, spEntityId, relayState);
} else if (profile.equals(IFSConstants.SSO_PROF_BROWSER_POST)) {
returnHandler = new FSSSOBrowserPostProfileHandler(request, response, authnRequest, spDescriptor, spConfig, spEntityId, relayState);
} else if (profile.equals(IFSConstants.SSO_PROF_WML_POST)) {
returnHandler = new FSSSOWMLPostProfileHandler(request, response, authnRequest, spDescriptor, spConfig, spEntityId, relayState);
} else if (profile.equals(IFSConstants.SSO_PROF_LECP)) {
returnHandler = new FSSSOLECPProfileHandler(request, response, authnRequest, spDescriptor, spConfig, spEntityId, relayState);
} else {
FSUtils.debug.error("FSServiceManager.getSSOAndFedHandler: " + "Unknown Protocol profile request");
returnHandler = new FSSSOBrowserArtifactProfileHandler(request, response, authnRequest, spDescriptor, spConfig, spEntityId, relayState);
}
} else {
if (FSUtils.debug.messageEnabled()) {
FSUtils.debug.message("FSServiceManager.getSSOAndFedHandler: " + "No protocol profile in the Request");
}
returnHandler = new FSSSOBrowserArtifactProfileHandler(request, response, authnRequest, spDescriptor, spConfig, spEntityId, relayState);
}
return returnHandler;
} catch (IDFFMetaException ex) {
FSUtils.debug.error("FSServiceManager.getSSOAndFedHandler: ", ex);
return null;
}
}
Aggregations