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

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


        for (Object descriptorType : descriptors) {
            if (!(descriptorType instanceof EntityDescriptorType)) {
                fail("Wrong type: " + descriptorType.getClass());
            }

            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


    }

    @Test
    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

        List<EDTDescriptorChoiceType> edtList = new ArrayList<EntityDescriptorType.EDTDescriptorChoiceType>();
        edtList.add(edtDescriptorChoiceType);

        EDTChoiceType choiceType = new EDTChoiceType(edtList);

        EntityDescriptorType entity = new EntityDescriptorType(" ");
        entity.addChoiceType(choiceType);
        return entity;
    }
View Full Code Here

        assertEquals(lang, org.getOrganizationURL().get(0).getLang());
    }

    @Test
    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);
View Full Code Here

        assertNotNull("SP Entity Descriptor not null", spEntity);
    }

    @Test
    public void testCreateIDPSSODescriptor() {
        IDPSSODescriptorType idp = this.createIDPSSODescriptor();
        assertNotNull("IDPSSODescriptor is not null", idp);
    }
View Full Code Here

     * @return
     */
    public static IDPSSODescriptorType createIDPSSODescriptor(boolean requestsSigned, KeyDescriptorType keyDescriptorType,
            EndpointType ssoEndPoint, EndpointType sloEndPoint, List<AttributeType> attributes, OrganizationType org) {
        List<String> emptyList = new ArrayList<String>();
        IDPSSODescriptorType idp = new IDPSSODescriptorType(emptyList);
        idp.addSingleSignOnService(ssoEndPoint);
        idp.addSingleLogoutService(sloEndPoint);

        for (AttributeType attr : attributes) {
            idp.addAttribute(attr);
        }
        idp.addKeyDescriptor(keyDescriptorType);
        idp.setWantAuthnRequestsSigned(requestsSigned);
        idp.setOrganization(org);
        return idp;
    }
View Full Code Here

        SPType spType = new SPType();
        String identityURL = null;
        String serviceURL = null;

        if (identityURL == null) {
            IDPSSODescriptorType idpSSO = getIDPDescriptor(entityDescriptor);
            if (idpSSO != null) {
                identityURL = getIdentityURL(idpSSO, bindingURI);
                spType.setIdentityURL(identityURL);
                spType.setLogoutUrl(getLogoutURL(idpSSO, bindingURI));
                spType.setLogoutResponseLocation(getLogoutResponseLocation(idpSSO, bindingURI));
View Full Code Here

            throws ConfigurationException {
        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) {
View Full Code Here

     *
     * @param entitiesDescriptor
     * @return
     */
    public static IDPSSODescriptorType getIDPDescriptor(EntitiesDescriptorType entitiesDescriptor) {
        IDPSSODescriptorType idp = null;
        List<Object> entitiesList = entitiesDescriptor.getEntityDescriptor();
        for (Object theObject : entitiesList) {
            if (theObject instanceof EntitiesDescriptorType) {
                idp = getIDPDescriptor((EntitiesDescriptorType) theObject);
            } else if (theObject instanceof EntityDescriptorType) {
View Full Code Here

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

TOP

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

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.