Examples of SAML11AuthorizationDecisionQueryType


Examples of org.picketlink.identity.federation.saml.v1.protocol.SAML11AuthorizationDecisionQueryType

            } else if (SAML11Constants.ASSERTION_ARTIFACT.equals(elementName)) {
                startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
                request.addAssertionArtifact(StaxParserUtil.getElementText(xmlEventReader));
            } else if (SAML11Constants.AUTHORIZATION_DECISION_QUERY.equals(elementName)) {
                startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
                SAML11AuthorizationDecisionQueryType query = SAML11ParserUtil
                        .parseSAML11AuthorizationDecisionQueryType(xmlEventReader);
                request.setQuery(query);
            } else if (elementName.equals(JBossSAMLConstants.SIGNATURE.get())) {
                request.setSignature(StaxParserUtil.getDOMElement(xmlEventReader));
            } else if (SAML11Constants.ASSERTION_ID_REF.equals(elementName)) {
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v1.protocol.SAML11AuthorizationDecisionQueryType

            write(attQuery);
        } else if (query instanceof SAML11AuthenticationQueryType) {
            SAML11AuthenticationQueryType attQuery = (SAML11AuthenticationQueryType) query;
            write(attQuery);
        } else if (query instanceof SAML11AuthorizationDecisionQueryType) {
            SAML11AuthorizationDecisionQueryType attQuery = (SAML11AuthorizationDecisionQueryType) query;
            write(attQuery);
        }

        StaxUtil.writeEndElement(writer);
        StaxUtil.flush(writer);
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v1.protocol.SAML11AuthorizationDecisionQueryType

     * @return
     * @throws ParsingException
     */
    public static SAML11AuthorizationDecisionQueryType parseSAML11AuthorizationDecisionQueryType(XMLEventReader xmlEventReader)
            throws ParsingException {
        SAML11AuthorizationDecisionQueryType query = new SAML11AuthorizationDecisionQueryType();
        StartElement startElement;
        // There may be additional things under subject confirmation
        while (xmlEventReader.hasNext()) {
            XMLEvent xmlEvent = StaxParserUtil.peek(xmlEventReader);
            if (xmlEvent instanceof EndElement) {
                EndElement endElement = StaxParserUtil.getNextEndElement(xmlEventReader);
                if (StaxParserUtil.matches(endElement, SAML11Constants.AUTHORIZATION_DECISION_QUERY))
                    break;
                else
                    throw logger.parserUnknownEndElement(StaxParserUtil.getEndElementName(endElement));
            }

            if (xmlEvent instanceof StartElement) {
                startElement = (StartElement) xmlEvent;

                String startTag = StaxParserUtil.getStartElementName(startElement);

                if (startTag.equals(JBossSAMLConstants.SUBJECT.get())) {
                    SAML11SubjectParser parser = new SAML11SubjectParser();
                    query.setSubject((SAML11SubjectType) parser.parse(xmlEventReader));
                } else if (startTag.equals(SAML11Constants.RESOURCE)) {
                    startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
                    query.setResource(URI.create(StaxParserUtil.getElementText(xmlEventReader)));
                } else if (startTag.equals(SAML11Constants.ACTION)) {
                    startElement = StaxParserUtil.getNextStartElement(xmlEventReader);
                    SAML11ActionType action = new SAML11ActionType();
                    Attribute nsAttr = startElement.getAttributeByName(new QName(SAML11Constants.NAMESPACE));
                    if (nsAttr != null) {
                        action.setNamespace(StaxParserUtil.getAttributeValue(nsAttr));
                    }

                    action.setValue(StaxParserUtil.getElementText(xmlEventReader));
                    query.add(action);
                } else
                    throw logger.parserUnknownTag(startTag, startElement.getLocation());
            }
        }
        return query;
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v1.protocol.SAML11AuthorizationDecisionQueryType

        assertEquals("R1234", request.getID());
        assertEquals(XMLTimeUtil.parse("2002-08-05T10:04:15"), request.getIssueInstant());

        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());
        List<SAML11ActionType> actions = attQuery.get();
        assertEquals(1, actions.size());
        SAML11ActionType action = actions.get(0);
        assertEquals("create", action.getValue());
        assertEquals("http://www.jboss.org", action.getNamespace());
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.