Package org.picketlink.identity.federation.core.config

Examples of org.picketlink.identity.federation.core.config.IDPType


     *
     * @param idpSSODescriptor
     * @return
     */
    public static IDPType getIDPType(IDPSSODescriptorType idpSSODescriptor) {
        IDPType idp = new IDPType();

        List<EndpointType> endpoints = idpSSODescriptor.getSingleSignOnService();

        if (endpoints != null) {
            for (EndpointType endpoint : endpoints) {
                if (endpoint.getBinding().toString().equals(JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get())) {
                    idp.setIdentityURL(endpoint.getLocation().toString());
                    break;
                }
            }
        }

        if (StringUtil.isNullOrEmpty(idp.getIdentityURL())) {
            throw logger.nullValueError("identity url");
        }
        return idp;
    }
View Full Code Here


        try {
            props.load(is);
        } catch (IOException e) {
            throw logger.processingError(e);
        }
        IDPType idp = new IDPType();
        idp.setIdentityURL(props.getProperty("idp.url"));
        String domains = props.getProperty("domains");
        if (StringUtil.isNotNull(domains)) {
            TrustType trustType = new TrustType();
            trustType.setDomains(domains);
            idp.setTrust(trustType);
        }

        return idp;
    }
View Full Code Here

    /**
     * @see SAMLConfigurationProvider#getIDPConfiguration()
     */
    public IDPType getIDPConfiguration() throws ProcessingException {
        IDPType idpType = null;
        if (fileAvailable()) {
            try {
                EntitiesDescriptorType entities = parseMDFile();
                IDPSSODescriptorType idpSSO = CoreConfigUtil.getIDPDescriptor(entities);
               
                if (idpSSO != null) {
                    idpType = CoreConfigUtil.getIDPType(idpSSO);
                }
               
                configureTrustedDomainsFromMetadata(idpType, entities);
            } catch (ParsingException e) {
                throw logger.processingError(e);
            }
        } else {
            throw logger.nullValueError(IDP_MD_FILE);
        }

        if (configParsedIDPType != null) {
            idpType.importFrom(configParsedIDPType);
        }

        return idpType;
    }
View Full Code Here

     * @return
     */
    private IDPWebBrowserSSOValve createIDPAuthenticator(boolean supportsSignatures) throws Exception {
        IDPWebBrowserSSOValve idpAuthenticator = new IDPWebBrowserSSOValve();

        IDPType idpType = new IDPType();

        idpType.setIdentityURL("http://localhost/idp");
        idpType.setSupportsSignature(supportsSignatures);

        idpAuthenticator.setConfigProvider(new MockSAMLConfigurationProvider(idpType));
        idpAuthenticator.setContainer(this.idpContext);

        idpAuthenticator.start();
View Full Code Here

        /*
         * assertTrue(object instanceof JAXBElement);
         *
         * IDPType idp = ((JAXBElement<IDPType>) object).getValue();
         */
        IDPType idp = (IDPType) object;
        assertEquals("org.picketlink.identity.federation.bindings.tomcat.TomcatRoleGenerator", idp.getRoleGenerator());

        TrustType trust = idp.getTrust();
        assertNotNull("Trust is not null", trust);
        String domains = trust.getDomains();
        assertTrue("localhost trusted", domains.indexOf("localhost") > -1);
        assertTrue("jboss.com trusted", domains.indexOf("jboss.com") > -1);
    }
View Full Code Here

    @Test
    public void test02() throws Exception {
        Object object = this.unmarshall(config + "2.xml");
        assertNotNull("IDP is not null", object);

        IDPType idp = (IDPType) object;
        assertEquals("somefqn", idp.getRoleGenerator());
        assertTrue(idp.isEncrypt());
        assertEquals(CanonicalizationMethod.EXCLUSIVE, idp.getCanonicalizationMethod());
        KeyProviderType kp = idp.getKeyProvider();
        assertNotNull("KeyProvider is not null", kp);
        assertEquals("SomeClass", "SomeClass", kp.getClassName());
        List<AuthPropertyType> authProps = kp.getAuth();
        AuthPropertyType authProp = authProps.get(0);
        assertEquals("SomeKey", "SomeKey", authProp.getKey());
        assertEquals("SomeValue", "SomeValue", authProp.getValue());

        authProp = authProps.get(1);
        assertEquals("DBURL", "DBURL", authProp.getKey());
        assertEquals("SomeDBURL", "SomeDBURL", authProp.getValue());

        List<KeyValueType> validatingAliases = kp.getValidatingAlias();
        assertEquals("Validating Alias length is 2", 2, validatingAliases.size());

        KeyValueType kv = validatingAliases.get(0);
        assertEquals("localhost", kv.getKey());
        assertEquals("localhostalias", kv.getValue());

        kv = validatingAliases.get(1);
        assertEquals("jboss.com", kv.getKey());
        assertEquals("jbossalias", kv.getValue());

        TrustType trust = idp.getTrust();
        assertNotNull("Trust is not null", trust);
        String domains = trust.getDomains();
        assertTrue("localhost trusted", domains.indexOf("localhost") > -1);
        assertTrue("jboss.com trusted", domains.indexOf("jboss.com") > -1);
    }
View Full Code Here

        InputStream configStream = tcl.getResourceAsStream("parser/config/picketlink-idp.xml");
        PicketLinkConfigParser parser = new PicketLinkConfigParser();
        Object result = parser.parse(configStream);
        assertNotNull(result);
        PicketLinkType picketlink = (PicketLinkType) result;
        IDPType idp = (IDPType) picketlink.getIdpOrSP();
        assertNotNull(idp);
        assertTrue(picketlink.isEnableAudit());
       
        // asserts the StrictPostBinding attribute. Default is true, but for this test it was changed to true in the configuration file.
        assertFalse(idp.isStrictPostBinding());
       
        assertEquals("TestIdentityParticipantStack", idp.getIdentityParticipantStack());
    }
View Full Code Here

        SAML2HandlerChainConfig chainConfig = new DefaultSAML2HandlerChainConfig();
        SAML2HandlerConfig handlerConfig = new DefaultSAML2HandlerConfig();

        Map<String, Object> chainOptions = new HashMap<String, Object>();
        IDPType idpType = new IDPType();
        idpType.setAttributeManager(TestAttributeManager.class.getName());
        chainOptions.put(GeneralConstants.CONFIGURATION, idpType);
        chainConfig.set(chainOptions);
       
        // Initialize the handler
        handler.initChainConfig(chainConfig);
View Full Code Here

        HTTPContext httpContext = new HTTPContext(servletRequest, servletResponse, servletContext);

        // Create chainConfig for IDP
        TrustType trustType = new TrustType();
        Map<String, Object> chainOptionsIdp = new HashMap<String, Object>();
        IDPType idpType = new IDPType();
        idpType.setTrust(trustType);
        chainOptionsIdp.put(GeneralConstants.CONFIGURATION, idpType);
        SAML2HandlerChainConfig chainConfigIdp = new DefaultSAML2HandlerChainConfig(chainOptionsIdp);
        issuerTrustHandler.initChainConfig(chainConfigIdp);

        // Create documentHolder
View Full Code Here

        idpHandlerRequest.addOption(GeneralConstants.ASSERTIONS_VALIDITY, 10000l);
        SAML2HandlerResponse idpHandlerResponse = new DefaultSAML2HandlerResponse();

        // Create chainConfig for IDP
        Map<String, Object> chainOptionsIdp = new HashMap<String, Object>();
        IDPType idpType = new IDPType();
        chainOptionsIdp.put(GeneralConstants.CONFIGURATION, idpType);
        chainOptionsIdp.put(GeneralConstants.ROLE_VALIDATOR_IGNORE, "true");
        SAML2HandlerChainConfig chainConfigIdp = new DefaultSAML2HandlerChainConfig(chainOptionsIdp);

        // Create and init handlers for IDP
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.core.config.IDPType

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.