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

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


    @Test
    public void testMetadataToSP() throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(idpMetadata);
        assertNotNull(is);
        SAMLParser parser = new SAMLParser();
        EntitiesDescriptorType entities = (EntitiesDescriptorType) parser.parse(is);
        assertNotNull(entities);

        ProviderType sp = CoreConfigUtil.getSPConfiguration((EntityDescriptorType) entities.getEntityDescriptor().get(0),
                JBossSAMLURIConstants.SAML_HTTP_POST_BINDING.get());
        assertNotNull(sp);
View Full Code Here


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

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

        assertEquals(XMLTimeUtil.parse("2009-05-26T14:06:26.362-05:00"), response.getIssueInstant());
        assertEquals("2.0", response.getVersion());
        assertEquals("ID_1164e0fc-576d-4797-b11c-3d049520f566", response.getID());
View Full Code Here

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

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

        assertEquals("ID_45df1ea5-81e4-4147-a39a-43a4ef613f4e", response.getID());
        assertEquals(XMLTimeUtil.parse("2010-11-04T00:19:16.847-05:00"), response.getIssueInstant());
        assertEquals("2.0", response.getVersion());
View Full Code Here

    public void testXACMLDecisionStatements() throws Exception {
        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("saml-xacml/saml-xacml-response-1.xml");
        validateSchema(configStream);
        configStream = tcl.getResourceAsStream("saml-xacml/saml-xacml-response-1.xml");
        SAMLParser parser = new SAMLParser();
        ResponseType response = (ResponseType) parser.parse(configStream);
        assertNotNull("ResponseType is not null", response);

        // Get the assertion
        AssertionType assertion = response.getAssertions().get(0).getAssertion();
        assertEquals("ID_response-id_1", assertion.getID());
View Full Code Here

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

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

        List<RTChoiceType> choices = response.getAssertions();
        assertEquals(1, choices.size());
        RTChoiceType rtc = choices.get(0);
View Full Code Here

    public void testSalesforceResponse() throws Exception {
        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream("parser/saml2/saml2-response-salesforce.xml");
        validateSchema(configStream);
        configStream = tcl.getResourceAsStream("parser/saml2/saml2-response-salesforce.xml");
        SAMLParser parser = new SAMLParser();
        ResponseType response = (ResponseType) parser.parse(configStream);
        assertNotNull("ResponseType is not null", response);
    }
View Full Code Here

        ClassLoader tcl = Thread.currentThread().getContextClassLoader();
        InputStream configStream = tcl.getResourceAsStream(fileName);
        /*
         * validateSchema(configStream); configStream = tcl.getResourceAsStream(fileName);
         */
        SAMLParser parser = new SAMLParser();
        ResponseType response = (ResponseType) parser.parse(configStream);
        assertNotNull("ResponseType is not null", response);
    }
View Full Code Here

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

        SAMLParser parser = new SAMLParser();
        SAML11RequestType request = (SAML11RequestType) parser.parse(configStream);
        assertNotNull(request);

        assertEquals(1, request.getMajorVersion());
        assertEquals(1, request.getMinorVersion());
        assertEquals("aaf23196-1773-2113-474a-fe114412ab72", request.getID());
View Full Code Here

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

        SAMLParser parser = new SAMLParser();
        SAML11RequestType request = (SAML11RequestType) parser.parse(configStream);
        assertNotNull(request);

        assertEquals(1, request.getMajorVersion());
        assertEquals(1, request.getMinorVersion());
        assertEquals("aaf23196-1773-2113-474a-fe114412ab72", request.getID());
View Full Code Here

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

        SAMLParser parser = new SAMLParser();
        SAML11RequestType request = (SAML11RequestType) parser.parse(configStream);
        assertNotNull(request);

        assertEquals(1, request.getMajorVersion());
        assertEquals(1, request.getMinorVersion());
        assertEquals("R1234", request.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.