use of com.sun.identity.federation.services.fednsso.FSSSOLECPProfileHandler in project OpenAM by OpenRock.
the class FSSOAPReceiver method handleLECPRequest.
private void handleLECPRequest(HttpServletRequest request, HttpServletResponse response, FSAuthnRequest authnRequest) {
FSUtils.debug.message("FSSOAPReceiver.handleLECPRequest: Called");
try {
String metaAlias = FSServiceUtils.getMetaAlias(request);
String realm = IDFFMetaUtils.getRealmByMetaAlias(metaAlias);
IDFFMetaManager metaManager = FSUtils.getIDFFMetaManager();
String hostedEntityId = metaManager.getEntityIDByMetaAlias(metaAlias);
FSSessionManager sessionService = FSSessionManager.getInstance(metaAlias);
sessionService.setAuthnRequest(authnRequest.getRequestID(), authnRequest);
// handle sso
FSServiceManager sm = FSServiceManager.getInstance();
FSSSOLECPProfileHandler handler = sm.getLECPProfileHandler(request, response, authnRequest, realm);
handler.setMetaAlias(metaAlias);
handler.setHostedEntityId(hostedEntityId);
handler.setHostedDescriptor(metaManager.getIDPDescriptor(realm, hostedEntityId));
handler.setHostedDescriptorConfig(metaManager.getIDPDescriptorConfig(realm, hostedEntityId));
handler.setRealm(realm);
handler.processLECPAuthnRequest(authnRequest);
} catch (Exception se) {
FSUtils.debug.error("FSSSOAndFedService.onMessage: Exception occured ", se);
return;
}
}
use of com.sun.identity.federation.services.fednsso.FSSSOLECPProfileHandler 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;
}
}
use of com.sun.identity.federation.services.fednsso.FSSSOLECPProfileHandler in project OpenAM by OpenRock.
the class FSServiceManager method getLECPProfileHandler.
/**
* Returns handler at <code>IDP</code> that handles <code>LECP</code>
* profile.
* @param request http request object
* @param response http response object
* @param authnRequest authentication request
* @param realm The realm under which the entity resides.
* @return <code>FSSSOLECPProfileHandler</code> object
*/
public FSSSOLECPProfileHandler getLECPProfileHandler(HttpServletRequest request, HttpServletResponse response, FSAuthnRequest authnRequest, String realm) {
FSUtils.debug.message("FSServiceManager.getLECPProfileHandler:Called");
try {
if ((request == null) || (response == null) || (authnRequest == null)) {
FSUtils.debug.error("FSServiceManager.getLECPProfileHandler: " + FSUtils.bundle.getString("nullInputParameter"));
return null;
}
IDFFMetaManager metaManager = FSUtils.getIDFFMetaManager();
String spEntityId = authnRequest.getProviderId();
return new FSSSOLECPProfileHandler(request, response, authnRequest, metaManager.getSPDescriptor(realm, spEntityId), metaManager.getSPDescriptorConfig(realm, spEntityId), spEntityId, authnRequest.getRelayState());
} catch (IDFFMetaException ex) {
FSUtils.debug.error("FSServiceManager.getLECPProfileHandler: ", ex);
return null;
}
}
Aggregations