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

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


    public void isTrusted(String issuer) throws IssuerNotTrustedException {
        if (idpConfiguration == null)
            throw logger.nullValueError("IDP Configuration");
        try {
            String issuerDomain = getDomain(issuer);
            TrustType idpTrust = idpConfiguration.getTrust();
            if (idpTrust != null) {
                String domainsTrusted = idpTrust.getDomains();
                logger.trace("Domains that IDP trusts = " + domainsTrusted + " and issuer domain = " + issuerDomain);
                if (domainsTrusted.indexOf(issuerDomain) < 0) {
                    // Let us do string parts checking
                    StringTokenizer st = new StringTokenizer(domainsTrusted, ",");
                    while (st != null && st.hasMoreTokens()) {
View Full Code Here


        }
        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

        SPType sp = new SPType();
        sp.setIdentityURL(props.getProperty("idp.url"));
        sp.setServiceURL("service.url");
        String domains = props.getProperty("domains");
        if (StringUtil.isNotNull(domains)) {
            TrustType trustType = new TrustType();
            trustType.setDomains(domains);
            sp.setTrust(trustType);
        }

        return sp;
    }
View Full Code Here

     * @param idpType
     * @param entities
     */
    private void configureTrustedDomainsFromMetadata(IDPType idpType, EntitiesDescriptorType entities) {
        if (idpType.getTrust() == null) {
            idpType.setTrust(new TrustType());
        }
       
        for (Object entityDescriptorObj : entities.getEntityDescriptor()) {
            EntityDescriptorType entityDescriptorType = (EntityDescriptorType) entityDescriptorObj;
            SPSSODescriptorType spDescriptor = CoreConfigUtil.getSPDescriptor(entityDescriptorType);
View Full Code Here

         * 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

        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

        MockHttpServletRequest servletRequest = new MockHttpServletRequest(session, "POST");
        MockHttpServletResponse servletResponse = new MockHttpServletResponse();
        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
        NameIDType issuer = new NameIDType();
        AuthnRequestType authnRequestType = new AuthnRequestType("ID_123456789", null);
        authnRequestType.setIssuer(issuer);
        SAMLDocumentHolder documentHolder = new SAMLDocumentHolder(authnRequestType);

        // Create request and response
        SAML2HandlerRequest request = new DefaultSAML2HandlerRequest(httpContext, null, documentHolder,
              SAML2Handler.HANDLER_TYPE.IDP);
        SAML2HandlerResponse response = new DefaultSAML2HandlerResponse();

        // Test localhost
        issuer.setValue("http://localhost:8080/sales");
        trustType.setDomains("localhost,google.com,somedomain.com");
        issuerTrustHandler.handleRequestType(request, response);

        // Test somedomain
        issuer.setValue("http://www.somedomain.com:8080/sales/");
        issuerTrustHandler.handleRequestType(request, response);
View Full Code Here

        private void trustIssuer(IDPType idpConfiguration, String issuer) throws ProcessingException {
            if (idpConfiguration == null)
                throw logger.nullArgumentError("IDP Configuration");
            try {
                String issuerDomain = getDomain(issuer);
                TrustType idpTrust = idpConfiguration.getTrust();
                if (idpTrust != null) {
                    String domainsTrusted = idpTrust.getDomains();

                    logger.trace("Domains that IDP trusts = " + domainsTrusted + " and issuer domain = " + issuerDomain);
                   
                    if (domainsTrusted.indexOf(issuerDomain) < 0) {
                        // Let us do string parts checking
View Full Code Here

    protected void isTrusted(String issuer) throws IssuerNotTrustedException {
        try {
            URL url = new URL(issuer);
            String issuerDomain = url.getHost();
            TrustType idpTrust = spConfiguration.getTrust();
            if (idpTrust != null) {
                String domainsTrusted = idpTrust.getDomains();
                if (domainsTrusted.indexOf(issuerDomain) < 0)
                    throw new IssuerNotTrustedException(issuer);
            }
        } catch (Exception e) {
            throw new IssuerNotTrustedException(e.getLocalizedMessage(), e);
View Full Code Here

        IDPType idp = provider.getIDPConfiguration();
        assertNotNull(idp);
        assertEquals("https://idp.testshib.org/idp/profile/SAML2/POST/SSO", idp.getIdentityURL());

        TrustType trust = idp.getTrust();
        assertNotNull(trust);
        assertEquals("localhost,jboss.com,jboss.org", trust.getDomains());

        assertEquals("org.picketlink.identity.federation.core.impl.EmptyAttributeManager", idp.getAttributeManager());
    }
View Full Code Here

TOP

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

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.