Search in sources :

Example 1 with FSSSOLECPProfileHandler

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;
    }
}
Also used : FSSSOLECPProfileHandler(com.sun.identity.federation.services.fednsso.FSSSOLECPProfileHandler) IDFFMetaManager(com.sun.identity.federation.meta.IDFFMetaManager) SOAPException(javax.xml.soap.SOAPException) SystemConfigurationException(com.sun.identity.common.SystemConfigurationException) IDFFMetaException(com.sun.identity.federation.meta.IDFFMetaException) FSMsgException(com.sun.identity.federation.message.common.FSMsgException) FSException(com.sun.identity.federation.common.FSException)

Example 2 with FSSSOLECPProfileHandler

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

Example 3 with FSSSOLECPProfileHandler

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;
    }
}
Also used : FSSSOLECPProfileHandler(com.sun.identity.federation.services.fednsso.FSSSOLECPProfileHandler) IDFFMetaManager(com.sun.identity.federation.meta.IDFFMetaManager) IDFFMetaException(com.sun.identity.federation.meta.IDFFMetaException)

Aggregations

IDFFMetaException (com.sun.identity.federation.meta.IDFFMetaException)3 IDFFMetaManager (com.sun.identity.federation.meta.IDFFMetaManager)3 FSSSOLECPProfileHandler (com.sun.identity.federation.services.fednsso.FSSSOLECPProfileHandler)3 SystemConfigurationException (com.sun.identity.common.SystemConfigurationException)1 FSException (com.sun.identity.federation.common.FSException)1 BaseConfigType (com.sun.identity.federation.jaxb.entityconfig.BaseConfigType)1 FSMsgException (com.sun.identity.federation.message.common.FSMsgException)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 FSSSOWMLPostProfileHandler (com.sun.identity.federation.services.fednsso.FSSSOWMLPostProfileHandler)1 SPDescriptorType (com.sun.identity.liberty.ws.meta.jaxb.SPDescriptorType)1 SOAPException (javax.xml.soap.SOAPException)1