Package org.picketlink.identity.federation.saml.v2.metadata

Examples of org.picketlink.identity.federation.saml.v2.metadata.SPSSODescriptorType


    public void testFileBasedEntityMetadataProvider() {
        FileBasedEntityMetadataProvider metadataProvider = new FileBasedEntityMetadataProvider();
        EntityDescriptorType metadata = getMetadata(metadataProvider, "saml2/metadata/sp-entitydescriptor.xml");

        assertEquals(metadata.getEntityID(), "https://service.example.org/shibboleth");
        SPSSODescriptorType spSSODescriptor = CoreConfigUtil.getSPDescriptor(metadata);
        assertNull(spSSODescriptor.isAuthnRequestsSigned());
        assertEquals(spSSODescriptor.getSingleLogoutService().size(), 4);
    }
View Full Code Here


            }

            EntityDescriptorType entDescriptorType = (EntityDescriptorType)descriptorType;

            if ("https://saml.salesforce.com".equals(entDescriptorType.getEntityID())) {
                SPSSODescriptorType spDescriptor = CoreConfigUtil.getSPDescriptor(entDescriptorType);

                assertTrue(spDescriptor.isAuthnRequestsSigned());
                List<EndpointType> logoutEndpoints = spDescriptor.getSingleLogoutService();
                assertNotNull(logoutEndpoints);
                assertEquals(logoutEndpoints.size(), 1);
                EndpointType endpoint = logoutEndpoints.get(0);
                assertEquals("https://login.salesforce.com/saml/logout-request.jsp?saml=MgoTx78aEPkEM4eGV5ZzptlliwIVkRkOWYKlqXQq2StV_sLo0EiRqKYtIc",
                      endpoint.getLocation().toASCIIString());
                assertEquals("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", endpoint.getBinding().toASCIIString());
            }
            else if ("google.com/a/somedomain.com".equals(entDescriptorType.getEntityID())) {
                SPSSODescriptorType spDescriptor = CoreConfigUtil.getSPDescriptor(entDescriptorType);

                assertFalse(spDescriptor.isAuthnRequestsSigned());
                List<EndpointType> logoutEndpoints = spDescriptor.getSingleLogoutService();
                assertNotNull(logoutEndpoints);
                assertEquals(logoutEndpoints.size(), 0);
            }
            else {
                fail("Wrong entityID: " + entDescriptorType.getEntityID());
View Full Code Here

    public void testCreateEntityDescriptor() {
        IDPSSODescriptorType idp = this.createIDPSSODescriptor();
        EntityDescriptorType idpEntity = MetaDataBuilder.createEntityDescriptor(idp);
        assertNotNull("IDP Entity Descriptor not null", idpEntity);

        SPSSODescriptorType sp = this.createSPSSODescriptor();
        EntityDescriptorType spEntity = MetaDataBuilder.createEntityDescriptor(sp);
        assertNotNull("SP Entity Descriptor not null", spEntity);
    }
View Full Code Here

        assertNotNull("IDPSSODescriptor is not null", idp);
    }

    @Test
    public void testCreateSPSSODescriptor() {
        SPSSODescriptorType sp = createSPSSODescriptor();

        assertNotNull("IDPSSODescriptor is not null", sp);
    }
View Full Code Here

        List<AttributeType> attributes = new ArrayList<AttributeType>();

        EndpointType sloEndPoint = MetaDataBuilder.createEndpoint(JBossSAMLURIConstants.METADATA_HTTP_REDIRECT_BINDING.get(),
                "https://SProvider.com/SAML/SLO/Browser", "https://SProvider.com/SAML/SLO/Response");

        SPSSODescriptorType sp = MetaDataBuilder.createSPSSODescriptor(true, keyDescriptorType, sloEndPoint, attributes,
                createJBossOrganization(lang));
        return sp;
    }
View Full Code Here

    public static SPSSODescriptorType createSPSSODescriptor(boolean requestsSigned, KeyDescriptorType keyDescriptorType,
            EndpointType sloEndPoint, List<AttributeType> attributes, OrganizationType org) {
        List<String> protocolEnumList = new ArrayList<String>();
        protocolEnumList.add(JBossSAMLURIConstants.PROTOCOL_NSURI.get());

        SPSSODescriptorType sp = new SPSSODescriptorType(protocolEnumList);
        sp.addSingleLogoutService(sloEndPoint);
        sp.addKeyDescriptor(keyDescriptorType);
        sp.setAuthnRequestsSigned(requestsSigned);
        sp.setOrganization(org);
        return sp;
    }
View Full Code Here

                spType.setLogoutUrl(getLogoutURL(idpSSO, bindingURI));
                spType.setLogoutResponseLocation(getLogoutResponseLocation(idpSSO, bindingURI));
            }
        }
        if (serviceURL == null) {
            SPSSODescriptorType spSSO = getSPDescriptor(entityDescriptor);
            if (spSSO != null) {
                serviceURL = getServiceURL(spSSO, bindingURI);
            }
            spType.setServiceURL(serviceURL);
        }
View Full Code Here

        SPType spType = new SPType();

        List<Object> list = entitiesDescriptor.getEntityDescriptor();

        IDPSSODescriptorType idpSSO = null;
        SPSSODescriptorType spSSO = null;

        if (list != null) {
            for (Object theObject : list) {
                if (theObject instanceof EntitiesDescriptorType) {
                    spType = getSPConfiguration((EntitiesDescriptorType) theObject, bindingURI);
View Full Code Here

    public static SPSSODescriptorType getSPDescriptor(EntityDescriptorType entityDescriptor) {
        List<EDTChoiceType> edtChoices = entityDescriptor.getChoiceType();
        for (EDTChoiceType edt : edtChoices) {
            List<EDTDescriptorChoiceType> edtDescriptors = edt.getDescriptors();
            for (EDTDescriptorChoiceType edtDesc : edtDescriptors) {
                SPSSODescriptorType spSSO = edtDesc.getSpDescriptor();
                if (spSSO != null) {
                    return spSSO;
                }
            }
        }
View Full Code Here

            idpType.setTrust(new TrustType());
        }
       
        for (Object entityDescriptorObj : entities.getEntityDescriptor()) {
            EntityDescriptorType entityDescriptorType = (EntityDescriptorType) entityDescriptorObj;
            SPSSODescriptorType spDescriptor = CoreConfigUtil.getSPDescriptor(entityDescriptorType);
           
            if (spDescriptor != null) {
                for (IndexedEndpointType assertionConsumerService : spDescriptor.getAssertionConsumerService()) {
                    URI location = assertionConsumerService.getLocation();
                   
                    idpType.getTrust().addDomain(location.getHost());
                }
            }
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.saml.v2.metadata.SPSSODescriptorType

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.