Examples of SAML11AttributeType


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

        }

        List<SAML11AttributeDesignatorType> attributes = attr.get();
        for (SAML11AttributeDesignatorType attribute : attributes) {
            if (attribute instanceof SAML11AttributeType) {
                SAML11AttributeType sat = (SAML11AttributeType) attribute;
                assertionWriter.write(sat);
            } else
                throw logger.writerUnknownTypeError(attribute.getClass().getName());
        }
View Full Code Here

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

            }
            // Get the next start element
            startElement = StaxParserUtil.peekNextStartElement(xmlEventReader);
            String tag = startElement.getName().getLocalPart();
            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);
View Full Code Here

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

     * @throws ParsingException
     */
    public static SAML11AttributeType parseSAML11Attribute(XMLEventReader xmlEventReader) throws ParsingException {
        StartElement startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
        StaxParserUtil.validate(startElement, JBossSAMLConstants.ATTRIBUTE.get());
        SAML11AttributeType attributeType = null;

        Attribute name = startElement.getAttributeByName(new QName(SAML11Constants.ATTRIBUTE_NAME));
        if (name == null)
            throw logger.parserRequiredAttribute("Name");
        String attribName = StaxParserUtil.getAttributeValue(name);

        Attribute namesp = startElement.getAttributeByName(new QName(SAML11Constants.ATTRIBUTE_NAMESPACE));
        if (namesp == null)
            throw logger.parserRequiredAttribute("Namespace");
        String attribNamespace = StaxParserUtil.getAttributeValue(namesp);

        attributeType = new SAML11AttributeType(attribName, URI.create(attribNamespace));

        attributeType.add(parseAttributeValue(xmlEventReader));

        parseAttributeType(xmlEventReader, startElement, JBossSAMLConstants.ATTRIBUTE.get(), attributeType);
        return attributeType;
    }
View Full Code Here

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

        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());
        SAML11AttributeType attrib = attribs.get(0);
        assertEquals("urn:mace:dir:attribute-def:eduPersonAffiliation", attrib.getAttributeName());
        assertEquals("urn:mace:shibboleth:1.0:attributeNamespace:uri", attrib.getAttributeNamespace().toString());

        List<Object> attribValues = attrib.get();
        assertTrue(attribValues.contains("member"));
        assertTrue(attribValues.contains("student"));

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

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

        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();
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.