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

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


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

        SAMLParser parser = new SAMLParser();
        SAML11AssertionType assertion = (SAML11AssertionType) parser.parse(configStream);
        assertNotNull(assertion);

        // Validate assertion
        assertEquals(1, assertion.getMajorVersion());
        assertEquals(1, assertion.getMinorVersion());
View Full Code Here


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

        SAMLParser parser = new SAMLParser();
        SAML11AssertionType assertion = (SAML11AssertionType) parser.parse(configStream);
        assertNotNull(assertion);

        // Validate assertion
        assertEquals(1, assertion.getMajorVersion());
        assertEquals(1, assertion.getMinorVersion());
View Full Code Here

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

        SAMLParser parser = new SAMLParser();
        SAML11AssertionType assertion = (SAML11AssertionType) parser.parse(configStream);
        assertNotNull(assertion);

        // Validate assertion
        assertEquals(1, assertion.getMajorVersion());
        assertEquals(1, assertion.getMinorVersion());
View Full Code Here

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

        SAMLParser parser = new SAMLParser();
        AssertionType assertion = (AssertionType) parser.parse(configStream);
        assertNotNull(assertion);

        assertEquals("ID_ab0392ef-b557-4453-95a8-a7e168da8ac5", assertion.getID());
        assertEquals(XMLTimeUtil.parse("2010-09-30T19:13:37.869Z"), assertion.getIssueInstant());
        // Issuer
View Full Code Here

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

        SAMLParser parser = new SAMLParser();
        AssertionType assertion = (AssertionType) parser.parse(configStream);
        assertNotNull(assertion);

        assertEquals("ID_cf9efbf0-9d7f-4b4a-b77f-d83ecaafd374", assertion.getID());
        assertEquals(XMLTimeUtil.parse("2010-09-30T19:13:37.911Z"), assertion.getIssueInstant());
        assertEquals("2.0", assertion.getVersion());
View Full Code Here

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

        SAMLParser parser = new SAMLParser();
        AssertionType assertion = (AssertionType) parser.parse(configStream);
        assertNotNull(assertion);

        assertEquals("ID_b07b804c-7c29-ea16-7300-4f3d6f7928ac", assertion.getID());
        assertEquals(XMLTimeUtil.parse("2004-12-05T09:22:05Z"), assertion.getIssueInstant());
        assertEquals("2.0", assertion.getVersion());
View Full Code Here

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

        SAMLParser parser = new SAMLParser();
        AssertionType assertion = (AssertionType) parser.parse(configStream);
        assertNotNull(assertion);

        SubjectType subjectType = assertion.getSubject();
        STSubType stType = subjectType.getSubType();
        assertEquals("A_DUDE", ((NameIDType) stType.getBaseID()).getValue());
View Full Code Here

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

        SAMLParser parser = new SAMLParser();
        AssertionType assertion = (AssertionType) parser.parse(configStream);
        assertNotNull(assertion);

        // Subject
        SubjectType subject = assertion.getSubject();
        STSubType subType = subject.getSubType();
View Full Code Here

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

        SAMLParser parser = new SAMLParser();
        AssertionType assertion = (AssertionType) parser.parse(configStream);
        assertNotNull(assertion);
    }
View Full Code Here

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

        SAMLParser parser = new SAMLParser();
        EntitiesDescriptorType entities = (EntitiesDescriptorType) parser.parse(is);
        Assert.assertNotNull(entities);
        Assert.assertEquals(2, entities.getEntityDescriptor().size());
        EntityDescriptorType entity = (EntityDescriptorType) entities.getEntityDescriptor().get(0);
        IDPSSODescriptorType idp = entity.getChoiceType().get(0).getDescriptors().get(0).getIdpDescriptor();
        KeyDescriptorType keyDescriptor = idp.getKeyDescriptor().get(0);
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.