Package org.apache.cxf.fediz.core.config

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


        wfReq.setWa(FederationConstants.ACTION_SIGNIN);
        wfReq.setWresult(rstr);
       
        configurator = null;
        FederationContext config = getFederationConfigurator().getFederationContext("ROOT");
        FederationProtocol fp = (FederationProtocol)config.getProtocol();
        fp.setRoleDelimiter(",");

        FederationProcessor wfProc = new FederationProcessorImpl();
        FederationResponse wfRes = wfProc.processRequest(wfReq, config);
       
        Assert.assertEquals("Principal name wrong", TEST_USER,
View Full Code Here


        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());
       
        FederationProcessor wfProc = new FederationProcessorImpl();
View Full Code Here

        }
    }
   
    protected List<String> parseRoles(FederationContext config, List<Claim> claims) {
        List<String> roles = null;
        FederationProtocol fp = (FederationProtocol)config.getProtocol();
        if (fp.getRoleURI() != null) {
            URI roleURI = URI.create(fp.getRoleURI());
            String delim = fp.getRoleDelimiter();
            for (Claim c : claims) {
                if (roleURI.equals(c.getClaimType())) {
                    Object oValue = c.getValue();
                    if ((oValue instanceof String) && !"".equals((String)oValue)) {
                        if (delim == null) {
View Full Code Here

            writer.writeStartElement("fed", "TargetScope", WS_FEDERATION_NS);
            writer.writeStartElement("wsa", "EndpointReference", WS_ADDRESSING_NS);
            writer.writeStartElement("wsa", "Address", WS_ADDRESSING_NS);

            if (protocol instanceof FederationProtocol) {
                FederationProtocol fedprotocol = (FederationProtocol)protocol;
               
                Object realmObj = fedprotocol.getRealm();
                String realm = null;
                if (realmObj instanceof String) {
                    realm = (String)realmObj;
                } else if (realmObj instanceof CallbackHandler) {
                    //TODO
                    //If realm is resolved at runtime, metadata not updated
                }
               
                if (!(realm == null || "".equals(realm))) {
                    writer.writeCharacters(realm);
                }
            }
            // writer.writeCharacters("http://host:port/url from config");
            writer.writeEndElement(); // Address
            writer.writeEndElement(); // EndpointReference
            writer.writeEndElement(); // TargetScope

            if (protocol instanceof FederationProtocol) {
                FederationProtocol fedprotocol = (FederationProtocol)protocol;
                List<Claim> claims = fedprotocol.getClaimTypesRequested();
                if (claims != null && claims.size() > 0) {

                    // create ClaimsType section
                    writer.writeStartElement("fed", "ClaimTypesRequested", WS_FEDERATION_NS);
                    for (Claim claim : claims) {

                        writer.writeStartElement("auth", "ClaimType", WS_FEDERATION_NS);
                        writer.writeAttribute("Uri", claim.getType());
                        if (claim.isOptional()) {
                            writer.writeAttribute("Optional", "true");
                        } else {
                            writer.writeAttribute("Optional", "false");
                        }

                        writer.writeEndElement(); // ClaimType

                    }
                    writer.writeEndElement(); // ClaimsTypeRequested
                }
            }
            // create sign in endpoint section

            writer.writeStartElement("fed", "PassiveRequestorEndpoint", WS_FEDERATION_NS);
            writer.writeStartElement("wsa", "EndpointReference", WS_ADDRESSING_NS);
            writer.writeStartElement("wsa", "Address", WS_ADDRESSING_NS);

            if (protocol instanceof FederationProtocol) {
                FederationProtocol fedprotocol = (FederationProtocol)protocol;
                Object issuer = fedprotocol.getIssuer();
                if (issuer instanceof String && !"".equals(issuer)) {
                    writer.writeCharacters((String)issuer);
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.cxf.fediz.core.config.FederationProtocol

Copyright © 2018 www.massapicom. 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.