Package org.picketlink.identity.federation.core.parsers.saml

Examples of org.picketlink.identity.federation.core.parsers.saml.SAMLParser


    public void parseOrganizationAndContactPerson() throws Exception {
        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream is = tcl.getResourceAsStream("saml2/metadata/sp-entitydescOrgContact.xml");
        assertNotNull("Inputstream not null", is);

        SAMLParser parser = new SAMLParser();
        EntityDescriptorType entity = (EntityDescriptorType) parser.parse(is);
        assertNotNull(entity);
        OrganizationType org = entity.getOrganization();
        assertNotNull(org);

        List<ContactType> contactPersons = entity.getContactPerson();
View Full Code Here


    @Test
    public void testShibbolethMetadataExtensions() throws Exception {
        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream is = tcl.getResourceAsStream("saml2/metadata/testshib.org.idp-metadata.xml");
        assertNotNull("Inputstream not null", is);
        SAMLParser parser = new SAMLParser();

        EntitiesDescriptorType entities = (EntitiesDescriptorType) parser.parse(is);
        assertNotNull(entities);

        // Another md
        is = tcl.getResourceAsStream("saml2/metadata/shib.idp-metadata.xml");
        assertNotNull("Inputstream not null", is);

        EntityDescriptorType entity = (EntityDescriptorType) parser.parse(is);
        assertNotNull(entity);
    }
View Full Code Here

        System.out.println("Test is disabled because of heap space issues in test env");
        if (runTest) {
            ClassLoader tcl = Thread.currentThread().getContextClassLoader();
            InputStream is = tcl.getResourceAsStream("saml2/metadata/testshib-two-metadata.xml");
            assertNotNull("Inputstream not null", is);
            SAMLParser parser = new SAMLParser();

            EntitiesDescriptorType entities = (EntitiesDescriptorType) parser.parse(is);
            assertNotNull(entities);
            assertEquals("urn:mace:shibboleth:testshib:two", entities.getName());

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here

    @Test
    public void testSAMLLogOutRequestParsing() throws Exception {
        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/saml2/saml2-logout-request.xml");

        SAMLParser parser = new SAMLParser();
        LogoutRequestType lotRequest = (LogoutRequestType) parser.parse(configStream);
        assertNotNull(lotRequest);

        assertEquals("ID_c3b5ae86-7fea-4d8b-a438-a3f47d8e92c3", lotRequest.getID());
        assertEquals(XMLTimeUtil.parse("2010-07-29T13:46:20.647-05:00"), lotRequest.getIssueInstant());
        assertEquals("2.0", lotRequest.getVersion());
View Full Code Here

        InputStream configStream = tcl.getResourceAsStream("parser/saml2/saml2-logout-request-2.xml");

        JAXPValidationUtil.validate(configStream);
        configStream = tcl.getResourceAsStream("parser/saml2/saml2-logout-request-2.xml");

        SAMLParser parser = new SAMLParser();
        LogoutRequestType lotRequest = (LogoutRequestType) parser.parse(configStream);
        assertNotNull(lotRequest);

        // Try out writing
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        SAMLRequestWriter writer = new SAMLRequestWriter(StaxUtil.getXMLStreamWriter(baos));
View Full Code Here

    @Test
    public void testSAML11Response() throws Exception {
        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/saml1/saml1-response.xml");

        SAMLParser parser = new SAMLParser();
        SAML11ResponseType response = (SAML11ResponseType) parser.parse(configStream);
        assertNotNull(response);

        assertEquals(1, response.getMajorVersion());
        assertEquals(1, response.getMinorVersion());
        assertEquals("P1234", response.getID());
View Full Code Here

    @Test
    public void testSAML11ResponseWithStatusMessage() throws Exception {
        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/saml1/saml1-response-status-message.xml");

        SAMLParser parser = new SAMLParser();
        SAML11ResponseType response = (SAML11ResponseType) parser.parse(configStream);
        assertNotNull(response);

        assertEquals(1, response.getMajorVersion());
        assertEquals(1, response.getMinorVersion());
        assertEquals("P1234", response.getID());
View Full Code Here

    @Test
    public void testSAMLResponseParse() throws Exception {
        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/saml2/saml2-logout-response.xml");

        SAMLParser parser = new SAMLParser();
        StatusResponseType response = (StatusResponseType) parser.parse(configStream);
        assertNotNull("ResponseType is not null", response);

        assertEquals(XMLTimeUtil.parse("2010-07-29T13:46:03.862-05:00"), response.getIssueInstant());
        assertEquals("2.0", response.getVersion());
        assertEquals("ID_97d332a8-3224-4653-a1ff-65c966e56852", response.getID());
View Full Code Here

    @Test
    public void testSLOResponseWithSig() throws Exception {
        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/saml2/saml2-logout-response-sig.xml");

        SAMLParser parser = new SAMLParser();
        StatusResponseType response = (StatusResponseType) parser.parse(configStream);
        assertNotNull("ResponseType is not null", response);

        assertEquals(XMLTimeUtil.parse("2011-04-04T11:48:32.372-05:00"), response.getIssueInstant());
        assertEquals("2.0", response.getVersion());
        assertEquals("ID_2b178fbb-224c-4f01-950d-e3d1be2d3821", response.getID());
View Full Code Here

    @Test
    public void testSLOResponseFromSalesforce() throws Exception {
        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/saml2/saml2-logout-response-salesforce.xml");

        SAMLParser parser = new SAMLParser();
        StatusResponseType response = (StatusResponseType) parser.parse(configStream);
        assertNotNull("ResponseType is not null", response);

        assertEquals(XMLTimeUtil.parse("2012-06-08T10:00:31.924Z"), response.getIssueInstant());
        assertEquals("2.0", response.getVersion());
        assertEquals("_580ef9943601e7d453514edab43ff2d01339149631922", response.getID());
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.core.parsers.saml.SAMLParser

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.