Search in sources :

Example 1 with FSSSOAndFedHandler

use of com.sun.identity.federation.services.fednsso.FSSSOAndFedHandler 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;
    }
}
Also used : BaseConfigType(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType) FSSSOWMLPostProfileHandler(com.sun.identity.federation.services.fednsso.FSSSOWMLPostProfileHandler) FSSSOBrowserArtifactProfileHandler(com.sun.identity.federation.services.fednsso.FSSSOBrowserArtifactProfileHandler) FSSSOBrowserPostProfileHandler(com.sun.identity.federation.services.fednsso.FSSSOBrowserPostProfileHandler) FSSSOLECPProfileHandler(com.sun.identity.federation.services.fednsso.FSSSOLECPProfileHandler) IDFFMetaManager(com.sun.identity.federation.meta.IDFFMetaManager) IDFFMetaException(com.sun.identity.federation.meta.IDFFMetaException) SPDescriptorType(com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType) FSSSOAndFedHandler(com.sun.identity.federation.services.fednsso.FSSSOAndFedHandler)

Aggregations

BaseConfigType (com.sun.identity.federation.jaxb.entityconfig.BaseConfigType)1 IDFFMetaException (com.sun.identity.federation.meta.IDFFMetaException)1 IDFFMetaManager (com.sun.identity.federation.meta.IDFFMetaManager)1 FSSSOAndFedHandler (com.sun.identity.federation.services.fednsso.FSSSOAndFedHandler)1 FSSSOBrowserArtifactProfileHandler (com.sun.identity.federation.services.fednsso.FSSSOBrowserArtifactProfileHandler)1 FSSSOBrowserPostProfileHandler (com.sun.identity.federation.services.fednsso.FSSSOBrowserPostProfileHandler)1 FSSSOLECPProfileHandler (com.sun.identity.federation.services.fednsso.FSSSOLECPProfileHandler)1 FSSSOWMLPostProfileHandler (com.sun.identity.federation.services.fednsso.FSSSOWMLPostProfileHandler)1 SPDescriptorType (com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType)1