Examples of SAML11SubjectType


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

    public void write(SAML11AttributeStatementType statement) throws ProcessingException {
        StaxUtil.writeStartElement(writer, ASSERTION_PREFIX, JBossSAMLConstants.ATTRIBUTE_STATEMENT.get(),
                SAML11Constants.ASSERTION_11_NSURI);

        SAML11SubjectType subject = statement.getSubject();
        if (subject != null)
            write(subject);

        List<SAML11AttributeType> attributes = statement.get();
        if (attributes != null) {
View Full Code Here

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

        URI authMethod = authnStatement.getAuthenticationMethod();
        if (authMethod != null) {
            StaxUtil.writeAttribute(writer, SAML11Constants.AUTHENTICATION_METHOD, authMethod.toString());
        }

        SAML11SubjectType subject = authnStatement.getSubject();
        if (subject != null)
            write(subject);

        SAML11SubjectLocalityType locality = authnStatement.getSubjectLocality();
        if (locality != null)
View Full Code Here

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

        String resource = xacmlStat.getResource().toString();
        StaxUtil.writeAttribute(writer, SAML11Constants.RESOURCE, resource);

        StaxUtil.writeAttribute(writer, SAML11Constants.DECISION, xacmlStat.getDecision().name());

        SAML11SubjectType subject = xacmlStat.getSubject();
        if (subject != null)
            write(subject);

        List<SAML11ActionType> actions = xacmlStat.getActions();
        for (SAML11ActionType action : actions) {
View Full Code Here

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

     * @see {@link ParserNamespaceSupport#parse(XMLEventReader)}
     */
    public Object parse(XMLEventReader xmlEventReader) throws ParsingException {
        StaxParserUtil.getNextEvent(xmlEventReader);

        SAML11SubjectType subject = new SAML11SubjectType();

        // Peek at the next event
        while (xmlEventReader.hasNext()) {
            XMLEvent xmlEvent = StaxParserUtil.peek(xmlEventReader);
            if (xmlEvent instanceof EndElement) {
                EndElement endElement = (EndElement) xmlEvent;
                if (StaxParserUtil.matches(endElement, JBossSAMLConstants.SUBJECT.get())) {
                    endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
                    break;
                } else
                    throw logger.parserUnknownEndElement(StaxParserUtil.getEndElementName(endElement));
            }

            StartElement peekedElement = StaxParserUtil.peekNextStartElement(xmlEventReader);
            if (peekedElement == null)
                break;

            String tag = StaxParserUtil.getStartElementName(peekedElement);

            if (SAML11Constants.NAME_IDENTIFIER.equalsIgnoreCase(tag)) {
                peekedElement = StaxParserUtil.getNextStartElement(xmlEventReader);
                String val = StaxParserUtil.getElementText(xmlEventReader);
                SAML11NameIdentifierType nameID = new SAML11NameIdentifierType(val);
                Attribute formatAtt = peekedElement.getAttributeByName(new QName(SAML11Constants.FORMAT));
                if (formatAtt != null) {
                    nameID.setFormat(URI.create(StaxParserUtil.getAttributeValue(formatAtt)));
                }

                Attribute nameQAtt = peekedElement.getAttributeByName(new QName(SAML11Constants.NAME_QUALIFIER));
                if (nameQAtt != null) {
                    nameID.setNameQualifier(StaxParserUtil.getAttributeValue(nameQAtt));
                }

                SAML11SubjectTypeChoice subChoice = new SAML11SubjectTypeChoice(nameID);
                subject.setChoice(subChoice);
            } else if (JBossSAMLConstants.SUBJECT_CONFIRMATION.get().equalsIgnoreCase(tag)) {
                SAML11SubjectConfirmationType subjectConfirmationType = SAML11ParserUtil
                        .parseSAML11SubjectConfirmation(xmlEventReader);
                subject.setSubjectConfirmation(subjectConfirmationType);
            } else
                throw logger.parserUnknownTag(tag, peekedElement.getLocation());
        }
        return subject;
    }
View Full Code Here

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

        URI authMethod = auth.getAuthenticationMethod();
        if (authMethod != null) {
            StaxUtil.writeAttribute(writer, SAML11Constants.AUTHENTICATION_METHOD, authMethod.toString());
        }

        SAML11SubjectType subject = auth.getSubject();
        if (subject != null) {
            assertionWriter.write(subject);
        }

        StaxUtil.writeEndElement(writer);
View Full Code Here

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

        URI resource = attr.getResource();
        if (resource != null) {
            StaxUtil.writeAttribute(writer, SAML11Constants.RESOURCE, resource.toString());
        }

        SAML11SubjectType subject = attr.getSubject();
        if (subject != null) {
            assertionWriter.write(subject);
        }

        List<SAML11AttributeDesignatorType> attributes = attr.get();
View Full Code Here

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

        URI resource = attr.getResource();
        if (resource != null) {
            StaxUtil.writeAttribute(writer, SAML11Constants.RESOURCE, resource.toString());
        }

        SAML11SubjectType subject = attr.getSubject();
        if (subject != null) {
            assertionWriter.write(subject);
        }

        List<SAML11ActionType> actions = attr.get();
View Full Code Here

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

        try {
            issueInstant = XMLTimeUtil.getIssueInstant();
        } catch (ConfigurationException e) {
            throw new ProcessingException(e);
        }
        SAML11SubjectType subject = samlProtocolContext.getSubjectType();
        List<SAML11StatementAbstractType> statements = samlProtocolContext.getStatements();

        // generate an id for the new assertion.
        String assertionID = IDGenerator.create("ID_");
View Full Code Here

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

                issuer = StaxParserUtil.getElementText(xmlEventReader);

                assertion.setIssuer(issuer);
            } else if (JBossSAMLConstants.SUBJECT.get().equalsIgnoreCase(tag)) {
                SAML11SubjectParser subjectParser = new SAML11SubjectParser();
                SAML11SubjectType subject = (SAML11SubjectType) subjectParser.parse(xmlEventReader);
                SAML11SubjectStatementType subStat = new SAML11SubjectStatementType();
                subStat.setSubject(subject);
            } else if (JBossSAMLConstants.CONDITIONS.get().equalsIgnoreCase(tag)) {
                startElement = (StartElement) xmlEvent;
View Full Code Here

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

        // create a subject using the caller principal or on-behalf-of principal.
        String subjectName = principal == null ? "ANONYMOUS" : principal.getName();
        SAML11NameIdentifierType nameId = new SAML11NameIdentifierType(subjectName);
        nameId.setFormat(URI.create(SAML11Constants.FORMAT_UNSPECIFIED));
        SAML11SubjectType subject = new SAML11SubjectType();
        subject.setChoice(new SAML11SubjectType.SAML11SubjectTypeChoice(nameId));
        subject.setSubjectConfirmation(subjectConfirmation);

        // add the subject to an auth statement.
        SAML11AuthenticationStatementType authStatement = new SAML11AuthenticationStatementType(
                URI.create("urn:picketlink:auth"), lifetime.getCreated());
        authStatement.setSubject(subject);
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.