Examples of FederationContext


Examples of org.apache.cxf.fediz.core.config.FederationContext

    private FederationContext getContextConfiguration(String contextName) {
        if (configurator == null) {
            throw new IllegalStateException("No Fediz configuration available");
        }
        FederationContext config = configurator.getFederationContext(contextName);
        if (config == null) {
            throw new IllegalStateException("No Fediz configuration for context :" + contextName);
        }
        String catalinaHome = System.getProperty("catalina.home");
        if (catalinaHome != null && catalinaHome.length() > 0) {
            config.setRelativePath(catalinaHome);
        }
        return config;
    }
View Full Code Here

Examples of org.apache.cxf.fediz.core.config.FederationContext

           
            String contextName = request.getServletContext().getContextPath();
            if (contextName == null || contextName.isEmpty()) {
                contextName = "/";
            }
            FederationContext fedConfig = getContextConfiguration(contextName);
            FederationProcessor wfProc = new FederationProcessorImpl();
            try {
                Document metadata = wfProc.getMetaData(fedConfig);
                out.write(DOM2Writer.nodeToString(metadata));
                return;
View Full Code Here

Examples of org.apache.cxf.fediz.core.config.FederationContext

                String contextName = request.getServletContext().getContextPath();
                if (contextName == null || contextName.isEmpty()) {
                    contextName = "/";
                }
                FederationContext fedConfig = getContextConfiguration(contextName);

                FederationProcessor wfProc = new FederationProcessorImpl();
                try {
                    wfRes = wfProc.processRequest(wfReq, fedConfig);
                } catch (ProcessingException ex) {
                    LOG.error("Federation processing failed: " + ex.getMessage());
                    response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
                    return false;
                }
               
               
                // Validate the AudienceRestriction in Security Token (e.g. SAML)
                // against the configured list of audienceURIs
                if (wfRes.getAudience() != null) {
                    List<String> audienceURIs = fedConfig.getAudienceUris();
                    boolean validAudience = false;
                    for (String a : audienceURIs) {
                        if (wfRes.getAudience().startsWith(a)) {
                            validAudience = true;
                            break;
View Full Code Here

Examples of org.apache.cxf.fediz.core.config.FederationContext

        String contextName = request.getServletContext().getContextPath();
        if (contextName == null || contextName.isEmpty()) {
            contextName = "/";
        }
        FederationContext fedCtx = this.configurator.getFederationContext(contextName);
        String redirectURL = null;
        try {
            redirectURL = processor.createSignInRequest(request, fedCtx);
            if (redirectURL != null) {
                response.sendRedirect(redirectURL);
View Full Code Here

Examples of org.apache.cxf.fediz.core.config.FederationContext

        FederationRequest wfReq = new FederationRequest();
        wfReq.setWa(FederationConstants.ACTION_SIGNIN);
        wfReq.setWresult(DOM2Writer.nodeToString(doc));
       
        configurator = null;
        FederationContext config = getFederationConfigurator().getFederationContext("ROOT");

        FederationProcessor wfProc = new FederationProcessorImpl();
        try {
            wfProc.processRequest(wfReq, config);
            fail("Failure expected on missing security token in RSTR");
View Full Code Here

Examples of org.apache.cxf.fediz.core.config.FederationContext

        FederationRequest wfReq = new FederationRequest();
        wfReq.setWa("gugus");
        wfReq.setWresult(DOM2Writer.nodeToString(doc));
       
        configurator = null;
        FederationContext config = getFederationConfigurator().getFederationContext("ROOT");

        FederationProcessor wfProc = new FederationProcessorImpl();
        try {
            wfProc.processRequest(wfReq, config);
            fail("Failure expected due to invalid action");
View Full Code Here

Examples of org.apache.cxf.fediz.core.config.FederationContext

        FederationRequest wfReq = new FederationRequest();
        wfReq.setWa(FederationConstants.ACTION_SIGNIN);
        wfReq.setWresult("gugus");
       
        configurator = null;
        FederationContext config = getFederationConfigurator().getFederationContext("ROOT");

        FederationProcessor wfProc = new FederationProcessorImpl();
        try {
            wfProc.processRequest(wfReq, config);
            fail("Failure expected due to invalid wresult");
View Full Code Here

Examples of org.apache.cxf.fediz.core.config.FederationContext

        FederationRequest wfReq = new FederationRequest();
        wfReq.setWa(FederationConstants.ACTION_SIGNIN);
        wfReq.setWresult(rstr);
       
        configurator = null;
        FederationContext config = getFederationConfigurator().getFederationContext("ROOT");
       
        FederationProcessor wfProc = new FederationProcessorImpl();
        FederationResponse wfRes = wfProc.processRequest(wfReq, config);
       
        Assert.assertEquals("Principal name wrong", TEST_USER,
View Full Code Here

Examples of org.apache.cxf.fediz.core.config.FederationContext

        FederationRequest wfReq = new FederationRequest();
        wfReq.setWa(FederationConstants.ACTION_SIGNIN);
        wfReq.setWresult(rstr);
       
        configurator = null;
        FederationContext config = getFederationConfigurator().getFederationContext("ROOT");
       
        FederationProcessor wfProc = new FederationProcessorImpl();
        FederationResponse wfRes = wfProc.processRequest(wfReq, config);
       
        Assert.assertEquals("Principal name wrong", TEST_USER,
View Full Code Here

Examples of org.apache.cxf.fediz.core.config.FederationContext

        FederationRequest wfReq = new FederationRequest();
        wfReq.setWa(FederationConstants.ACTION_SIGNIN);
        wfReq.setWresult(rstr);
       
        configurator = null;
        FederationContext config = getFederationConfigurator().getFederationContext("ROOT");
       
        FederationProcessor wfProc = new FederationProcessorImpl();
        FederationResponse wfRes = wfProc.processRequest(wfReq, config);
       
        Assert.assertEquals("Principal name wrong", TEST_USER,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.