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

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


        // orgDisplayName
        LocalizedNameType orgDisplayName = new LocalizedNameType(lang);
        orgDisplayName.setValue(organizationDisplayName);

        // orgURL
        LocalizedURIType orgURL = new LocalizedURIType(lang);
        orgURL.setValue(URI.create(organizationURL));

        OrganizationType orgType = new OrganizationType();
        orgType.addOrganizationName(orgName);
        orgType.addOrganizationDisplayName(orgDisplayName);
        orgType.addOrganizationURL(orgURL);
View Full Code Here


                org.addOrganizationDisplayName(localName);
            } else if (JBossSAMLConstants.ORGANIZATION_URL.get().equals(localPart)) {
                startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
                Attribute lang = startElement.getAttributeByName(new QName(JBossSAMLURIConstants.XML.get(), "lang"));
                String langVal = StaxParserUtil.getAttributeValue(lang);
                LocalizedURIType localName = new LocalizedURIType(langVal);
                localName.setValue(URI.create(StaxParserUtil.getElementText(xmlEventReader)));
                org.addOrganizationURL(localName);
            } else if (JBossSAMLConstants.EXTENSIONS.get().equalsIgnoreCase(localPart)) {
                org.setExtensions(parseExtensions(xmlEventReader));
            } else
                throw logger.parserUnknownTag(localPart, startElement.getLocation());
View Full Code Here

    String organizationURL = "http://www.jboss.org";
    String lang = "en";

    @Test
    public void testCreateOrganization() {
        OrganizationType org = createJBossOrganization("en");

        assertNotNull("Org is not null", org);
        assertEquals(organizationName, org.getOrganizationName().get(0).getValue());
        assertEquals(organizationDisplayName, org.getOrganizationDisplayName().get(0).getValue());
        assertEquals(organizationURL, org.getOrganizationURL().get(0).getValue().toString());

        // Check the lang
        assertEquals(lang, org.getOrganizationName().get(0).getLang());
        assertEquals(lang, org.getOrganizationDisplayName().get(0).getLang());
        assertEquals(lang, org.getOrganizationURL().get(0).getLang());
    }
View Full Code Here

            app.setFullScopeAllowed(true);
            app.setProtocol(SamlProtocol.LOGIN_PROTOCOL);
            app.setAttribute(SamlProtocol.SAML_SERVER_SIGNATURE, SamlProtocol.ATTRIBUTE_TRUE_VALUE); // default to true
            app.setAttribute(SamlProtocol.SAML_SIGNATURE_ALGORITHM, SignatureAlgorithm.RSA_SHA256.toString());
            app.setAttribute(SamlProtocol.SAML_AUTHNSTATEMENT, SamlProtocol.ATTRIBUTE_TRUE_VALUE);
            SPSSODescriptorType spDescriptorType = CoreConfigUtil.getSPDescriptor(entity);
            if (spDescriptorType.isWantAssertionsSigned()) {
                app.setAttribute(SamlProtocol.SAML_ASSERTION_SIGNATURE, SamlProtocol.ATTRIBUTE_TRUE_VALUE);
            }
            String adminUrl = getLogoutLocation(spDescriptorType, JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get());
            if (adminUrl != null) app.setManagementUrl(adminUrl);

            String urlPattern = CoreConfigUtil.getServiceURL(spDescriptorType, JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get());
            if (urlPattern == null) {
                urlPattern = CoreConfigUtil.getServiceURL(spDescriptorType, JBossSAMLURIConstants.SAML_HTTP_REDIRECT_BINDING.get());
            }
            if (urlPattern != null) {
                app.addRedirectUri(urlPattern);
            }

            for (KeyDescriptorType keyDescriptor : spDescriptorType.getKeyDescriptor()) {
                X509Certificate cert = null;
                try {
                    cert = SAMLMetadataUtil.getCertificate(keyDescriptor);
                } catch (ConfigurationException e) {
                    throw new RuntimeException(e);
View Full Code Here

    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

     * @param response
     * @return
     */
    public static XACMLAuthzDecisionStatementType createXACMLAuthzDecisionStatementType(RequestType request,
            ResponseType response) {
        XACMLAuthzDecisionStatementType xacmlStatement = new XACMLAuthzDecisionStatementType();
        xacmlStatement.setRequest(request);
        xacmlStatement.setResponse(response);
        return xacmlStatement;
    }
View Full Code Here

TOP

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

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.