Examples of SAML11SubjectType


Examples of org.picketlink.identity.federation.saml.v1.assertion.SAML11SubjectType

            String tag = StaxParserUtil.getStartElementName(startElement);

            if (JBossSAMLConstants.SUBJECT.get().equalsIgnoreCase(tag)) {
                SAML11SubjectParser subjectParser = new SAML11SubjectParser();
                SAML11SubjectType subject = (SAML11SubjectType) subjectParser.parse(xmlEventReader);
                SAML11SubjectStatementType subStat = new SAML11SubjectStatementType();
                subStat.setSubject(subject);

                authStat.setSubject(subject);
            } else if (JBossSAMLConstants.SUBJECT_LOCALITY.get().equals(tag)) {
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v1.assertion.SAML11SubjectType

            if (JBossSAMLConstants.ATTRIBUTE.get().equals(tag)) {
                SAML11AttributeType attribute = parseSAML11Attribute(xmlEventReader);
                attributeStatementType.add(attribute);
            } else if (JBossSAMLConstants.SUBJECT.get().equals(tag)) {
                SAML11SubjectParser parser = new SAML11SubjectParser();
                SAML11SubjectType subject = (SAML11SubjectType) parser.parse(xmlEventReader);
                attributeStatementType.setSubject(subject);
            } else
                throw logger.parserUnknownTag(tag, startElement.getLocation());
        }
        return attributeStatementType;
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v1.assertion.SAML11SubjectType

        }
        assertNotNull("SAMLV1.1 assertion is missing the authentication statement", authStatement);

        // validate the assertion subject.
        assertNotNull("Unexpected null subject", authStatement.getSubject());
        SAML11SubjectType subject = authStatement.getSubject();

        SAML11NameIdentifierType nameID = subject.getChoice().getNameID();
        assertEquals("Unexpected NameIdentifier format", SAML11Constants.FORMAT_UNSPECIFIED, nameID.getFormat().toString());
        assertEquals("Unexpected NameIdentifier value", principal, nameID.getValue());

        SAML11SubjectConfirmationType subjType = subject.getSubjectConfirmation();
        assertEquals("Unexpected confirmation method", confirmationMethod, subjType.getConfirmationMethod().get(0).toString());

        // validate the assertion conditions.
        assertNotNull("Unexpected null conditions", assertion.getConditions());
        assertEquals(lifetime.getCreated(), assertion.getConditions().getNotBefore());
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v1.assertion.SAML11SubjectType

        SAML11AuthenticationStatementType stat = (SAML11AuthenticationStatementType) assertion.getStatements().get(0);
        assertEquals("urn:oasis:names:tc:SAML:1.0:am:password", stat.getAuthenticationMethod().toString());
        assertEquals(XMLTimeUtil.parse("2002-06-19T17:05:17.706Z"), stat.getAuthenticationInstant());

        SAML11SubjectType subject = stat.getSubject();
        SAML11SubjectType.SAML11SubjectTypeChoice choice = subject.getChoice();
        assertEquals("user@idp.example.org", choice.getNameID().getValue());
        assertEquals("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", choice.getNameID().getFormat().toString());

        SAML11SubjectConfirmationType subjectConfirm = subject.getSubjectConfirmation();
        URI confirmationMethod = subjectConfirm.getConfirmationMethod().get(0);
        assertEquals("urn:oasis:names:tc:SAML:1.0:cm:bearer", confirmationMethod.toString());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        // Lets do the writing
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v1.assertion.SAML11SubjectType

        SAML11AuthenticationStatementType stat = (SAML11AuthenticationStatementType) assertion.getStatements().get(0);
        assertEquals("urn:oasis:names:tc:SAML:1.0:am:password", stat.getAuthenticationMethod().toString());
        assertEquals(XMLTimeUtil.parse("2002-06-19T17:08:37.795Z"), stat.getAuthenticationInstant());

        SAML11SubjectType subject = stat.getSubject();
        SAML11SubjectType.SAML11SubjectTypeChoice choice = subject.getChoice();
        assertEquals("user@idp.example.org", choice.getNameID().getValue());
        assertEquals("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", choice.getNameID().getFormat().toString());

        SAML11SubjectConfirmationType subjectConfirm = subject.getSubjectConfirmation();
        URI confirmationMethod = subjectConfirm.getConfirmationMethod().get(0);
        assertEquals("urn:oasis:names:tc:SAML:1.0:cm:bearer", confirmationMethod.toString());

        SAML11AttributeStatementType attribStat = (SAML11AttributeStatementType) assertion.getStatements().get(1);
        assertNotNull(attribStat);
        subject = attribStat.getSubject();

        choice = subject.getChoice();
        assertEquals("user@idp.example.org", choice.getNameID().getValue());
        assertEquals("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", choice.getNameID().getFormat().toString());

        subjectConfirm = subject.getSubjectConfirmation();
        confirmationMethod = subjectConfirm.getConfirmationMethod().get(0);
        assertEquals("urn:oasis:names:tc:SAML:1.0:cm:bearer", confirmationMethod.toString());

        List<SAML11AttributeType> attribs = attribStat.get();
        assertEquals(1, attribs.size());
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v1.assertion.SAML11SubjectType

        List<SAML11StatementAbstractType> statements = assertion.getStatements();
        assertEquals(2, statements.size());

        SAML11AttributeStatementType attrStat = (SAML11AttributeStatementType) statements.get(0);
        SAML11SubjectType subject = attrStat.getSubject();
        SAML11SubjectTypeChoice choice = subject.getChoice();
        SAML11NameIdentifierType nameID = choice.getNameID();
        assertEquals("johnq", nameID.getValue());
        SAML11SubjectConfirmationType subjConf = subject.getSubjectConfirmation();
        URI confirmationMethod = subjConf.getConfirmationMethod().get(0);
        assertEquals("urn:oasis:names:tc:SAML:1.0:cm:artifact", confirmationMethod.toString());

        List<SAML11AttributeType> attributes = attrStat.get();
        assertEquals(4, attributes.size());
        SAML11AttributeType attr = attributes.get(0);
        assertEquals("uid", attr.getAttributeName());
        assertEquals("http://jboss.org/test", attr.getAttributeNamespace().toString());
        assertEquals("12345", attr.get().get(0));

        attr = attributes.get(1);
        assertEquals("groupMembership", attr.getAttributeName());
        assertEquals("http://jboss.org/test", attr.getAttributeNamespace().toString());
        assertEquals("uugid=middleware.staff,ou=Groups,dc=vt,dc=edu", attr.get().get(0));

        attr = attributes.get(2);
        assertEquals("eduPersonAffiliation", attr.getAttributeName());
        assertEquals("http://jboss.org/test", attr.getAttributeNamespace().toString());
        assertEquals("staff", attr.get().get(0));

        attr = attributes.get(3);
        assertEquals("accountState", attr.getAttributeName());
        assertEquals("http://jboss.org/test", attr.getAttributeNamespace().toString());
        assertEquals("ACTIVE", attr.get().get(0));

        SAML11AuthenticationStatementType authStat = (SAML11AuthenticationStatementType) statements.get(1);
        assertEquals(XMLTimeUtil.parse("2008-12-10T14:12:14.741Z"), authStat.getAuthenticationInstant());
        assertEquals("urn:oasis:names:tc:SAML:1.0:am:password", authStat.getAuthenticationMethod().toString());
        subject = authStat.getSubject();
        choice = subject.getChoice();
        nameID = choice.getNameID();
        assertEquals("johnq", nameID.getValue());
        subjConf = subject.getSubjectConfirmation();
        confirmationMethod = subjConf.getConfirmationMethod().get(0);
        assertEquals("urn:oasis:names:tc:SAML:1.0:cm:artifact", confirmationMethod.toString());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        // Lets do the writing
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v1.assertion.SAML11SubjectType

        List<SAML11StatementAbstractType> statements = assertion.getStatements();
        assertEquals(1, statements.size());
        SAML11AuthenticationStatementType authStat = (SAML11AuthenticationStatementType) statements.get(0);
        assertEquals(XMLTimeUtil.parse("2006-05-24T05:52:30Z"), authStat.getAuthenticationInstant());
        assertEquals("urn:picketlink:auth", authStat.getAuthenticationMethod().toString());
        SAML11SubjectType subject = authStat.getSubject();
        SAML11SubjectTypeChoice choice = subject.getChoice();
        SAML11NameIdentifierType nameID = choice.getNameID();
        assertEquals("anil", nameID.getValue());
        SAML11SubjectConfirmationType subjConf = subject.getSubjectConfirmation();
        URI confirmationMethod = subjConf.getConfirmationMethod().get(0);
        assertEquals("urn:oasis:names:tc:SAML:1.0:cm:holder-of-key", confirmationMethod.toString());
        assertNotNull(subjConf.getKeyInfo());

        Element sig = assertion.getSignature();
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v1.assertion.SAML11SubjectType

        SAML11QueryAbstractType query = request.getQuery();
        assertTrue(query instanceof SAML11AuthenticationQueryType);
        SAML11AuthenticationQueryType attQuery = (SAML11AuthenticationQueryType) query;

        SAML11SubjectType subject = attQuery.getSubject();
        SAML11SubjectType.SAML11SubjectTypeChoice choice = subject.getChoice();
        assertEquals("myusername", choice.getNameID().getValue());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        // Lets do the writing
        SAML11RequestWriter writer = new SAML11RequestWriter(StaxUtil.getXMLStreamWriter(baos));
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v1.assertion.SAML11SubjectType

        SAML11QueryAbstractType query = request.getQuery();
        assertTrue(query instanceof SAML11AttributeQueryType);
        SAML11AttributeQueryType attQuery = (SAML11AttributeQueryType) query;

        SAML11SubjectType subject = attQuery.getSubject();
        SAML11SubjectType.SAML11SubjectTypeChoice choice = subject.getChoice();
        assertEquals("testID", choice.getNameID().getValue());

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        // Lets do the writing
        SAML11RequestWriter writer = new SAML11RequestWriter(StaxUtil.getXMLStreamWriter(baos));
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v1.assertion.SAML11SubjectType

        SAML11QueryAbstractType query = request.getQuery();
        assertTrue(query instanceof SAML11AuthorizationDecisionQueryType);
        SAML11AuthorizationDecisionQueryType attQuery = (SAML11AuthorizationDecisionQueryType) query;

        SAML11SubjectType subject = attQuery.getSubject();
        SAML11SubjectType.SAML11SubjectTypeChoice choice = subject.getChoice();
        assertEquals("anil@anil.org", choice.getNameID().getValue());
        assertEquals(SAML11Constants.FORMAT_EMAIL_ADDRESS, choice.getNameID().getFormat().toString());
        assertEquals("http://jboss.org", choice.getNameID().getNameQualifier());

        assertEquals("urn:jboss.resource", attQuery.getResource().toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.