Examples of FederationContext


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();
        try {
            wfProc.processRequest(wfReq, config);
            fail("Failure expected on expired SAML token");
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");
        config.setMaximumClockSkew(BigInteger.valueOf(60));
       
        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("CUSTTOK");
        FederationProtocol fp = (FederationProtocol)config.getProtocol();
        List<TokenValidator> validators = fp.getTokenValidators();
        Assert.assertEquals("Two validators must be found", 2, validators.size());
        Assert.assertEquals("First validator must be custom validator",
                            CustomValidator.class.getName(), validators.get(0).getClass().getName());
       
View Full Code Here

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

    protected 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 catalinaBase = System.getProperty("catalina.base");
        if (catalinaBase != null && catalinaBase.length() > 0) {
            config.setRelativePath(catalinaBase);
        }
        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

                        //String contextName = request.getServletContext().getContextPath();
                        String contextName = request.getSession().getServletContext().getContextPath();
                        if (contextName == null || contextName.isEmpty()) {
                            contextName = "/";
                        }
                        FederationContext fedConfig = getContextConfiguration(contextName);
                       
                        FederationLoginService fedLoginService = (FederationLoginService)this._loginService;
                        UserIdentity user = fedLoginService.login(null, wfReq, fedConfig);
                        if (user != null)
                        {
View Full Code Here

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

        //String contextName = request.getServletContext().getContextPath();
        String contextName = request.getSession().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

   
    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 jettyHome = System.getProperty("jetty.home");
        if (jettyHome != null && jettyHome.length() > 0) {
            config.setRelativePath(jettyHome);
        }
        return config;
    }
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.