Examples of XACMLAuthzDecisionQueryType


Examples of org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType

*/
public class XACMLAuthzDecisionQueryTypeMarshaller extends RequestAbstractTypeMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException {
        XACMLAuthzDecisionQueryType query = (XACMLAuthzDecisionQueryType) samlObject;

        if (query.getInputContextOnlyXSBooleanValue() != null) {
            domElement.setAttributeNS(null, XACMLAuthzDecisionQueryType.INPUTCONTEXTONLY_ATTRIB_NAME, query
                    .getInputContextOnlyXSBooleanValue().toString());
        }

        if (query.getReturnContextXSBooleanValue() != null) {
            domElement.setAttributeNS(null, XACMLAuthzDecisionQueryType.RETURNCONTEXT_ATTRIB_NAME, query
                    .getReturnContextXSBooleanValue().toString());
        }

        if (query.getCombinePoliciesXSBooleanValue() != null) {
            domElement.setAttributeNS(null, XACMLAuthzDecisionQueryType.COMBINEPOLICIES_ATTRIB_NAME, query
                    .getCombinePoliciesXSBooleanValue().toString());
        }

        super.marshallAttributes(samlObject, domElement);
    }
View Full Code Here

Examples of org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType

    ) {
        if (xacmlAuthzDecisionQueryTypeBuilder == null) {
            xacmlAuthzDecisionQueryTypeBuilder = (XACMLObjectBuilder<XACMLAuthzDecisionQueryType>)
                builderFactory.getBuilder(XACMLAuthzDecisionQueryType.DEFAULT_ELEMENT_NAME_XACML20);
        }
        XACMLAuthzDecisionQueryType authzQuery =
            xacmlAuthzDecisionQueryTypeBuilder.buildObject(
                namespace,
                XACMLAuthzDecisionQueryType.DEFAULT_ELEMENT_LOCAL_NAME,
                SAMLProfileConstants.SAML20XACMLPROTOCOL_PREFIX
            );
        authzQuery.setID("_" + UUID.randomUUID().toString());
        authzQuery.setVersion(SAMLVersion.VERSION_20);
        authzQuery.setIssueInstant(new DateTime());
        authzQuery.setInputContextOnly(Boolean.valueOf(inputContextOnly));
        authzQuery.setReturnContext(Boolean.valueOf(returnContext));
       
        if (issuerValue != null) {
            Issuer issuer = createIssuer(issuerValue);
            authzQuery.setIssuer(issuer);
        }
       
        authzQuery.setRequest(request);
       
        return authzQuery;
    }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.XACMLAuthzDecisionQueryType

           
            if (logger.isTraceEnabled()) {
                logger.trace("XACML Received Message: " + DocumentUtil.asString(doc));
            }
           
            XACMLAuthzDecisionQueryType xacmlQuery = SOAPSAMLXACMLUtil.getXACMLQueryType(doc);
            ResponseType samlResponseType = SOAPSAMLXACMLUtil.handleXACMLQuery(pdp, issuer, xacmlQuery);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            XMLStreamWriter xmlStreamWriter = StaxUtil.getXMLStreamWriter(baos);

            SAMLResponseWriter samlResponseWriter = new SAMLResponseWriter(xmlStreamWriter);
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.XACMLAuthzDecisionQueryType

        SAMLParser parser = new SAMLParser();
        RequestAbstractType req = (RequestAbstractType) parser.parse(is);
        assertNotNull(req);
        assertTrue(req instanceof XACMLAuthzDecisionQueryType);

        XACMLAuthzDecisionQueryType xadqt = (XACMLAuthzDecisionQueryType) req;
        RequestType requestType = xadqt.getRequest();
        assertNotNull(requestType);
    }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.XACMLAuthzDecisionQueryType

        SAMLParser parser = new SAMLParser();
        RequestAbstractType req = (RequestAbstractType) parser.parse(is);
        assertNotNull(req);
        assertTrue(req instanceof XACMLAuthzDecisionQueryType);

        XACMLAuthzDecisionQueryType xadqt = (XACMLAuthzDecisionQueryType) req;
        RequestType requestType = xadqt.getRequest();
        assertNotNull(requestType);
    }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.XACMLAuthzDecisionQueryType

        super.init(config);
    }

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        XACMLAuthzDecisionQueryType xacmlRequest = null;
        SOAPMessage returnSOAPMessage = null;
        try {
            try {
                SOAPMessage soapMessage = null;
                if (soapVersion.equals("1.2")) {
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.XACMLAuthzDecisionQueryType

    @SuppressWarnings("unchecked")
    private XACMLAuthzDecisionQueryType parseXACMLAuthzDecisionQuery(StartElement startElement, XMLEventReader xmlEventReader)
            throws ParsingException {
        super.parseRequiredAttributes(startElement);

        XACMLAuthzDecisionQueryType xacmlQuery = new XACMLAuthzDecisionQueryType(id, issueInstant);
        super.parseBaseAttributes(startElement, xacmlQuery);

        String inputContextOnly = StaxParserUtil.getAttributeValue(startElement, JBossSAMLConstants.INPUT_CONTEXT_ONLY.get());
        if (inputContextOnly != null) {
            xacmlQuery.setInputContextOnly(Boolean.parseBoolean(inputContextOnly));
        }
        String returnContext = StaxParserUtil.getAttributeValue(startElement, JBossSAMLConstants.RETURN_CONTEXT.get());
        if (returnContext != null) {
            xacmlQuery.setReturnContext(Boolean.parseBoolean(returnContext));
        }

        // Go thru the children
        while (xmlEventReader.hasNext()) {
            XMLEvent xmlEvent = StaxParserUtil.peek(xmlEventReader);
            if (xmlEvent instanceof EndElement) {
                EndElement endElement = (EndElement) xmlEvent;
                if (!(StaxParserUtil.matches(endElement, JBossSAMLConstants.REQUEST_ABSTRACT.get()) || StaxParserUtil.matches(
                        endElement, JBossSAMLConstants.XACML_AUTHZ_DECISION_QUERY.get())))
                    throw logger.parserExpectedEndTag("RequestAbstract or XACMLAuthzDecisionQuery");
                break;
            }
            startElement = StaxParserUtil.peekNextStartElement(xmlEventReader);
            if (startElement == null)
                break;
            super.parseCommonElements(startElement, xmlEventReader, xacmlQuery);
            String tag = StaxParserUtil.getStartElementName(startElement);

            if (tag.equals(JBossSAMLConstants.REQUEST.get())) {
                Element xacmlRequest = StaxParserUtil.getDOMElement(xmlEventReader);
                // xacml request
                String xacmlPath = "org.jboss.security.xacml.core.model.context";
                try {
                    JAXBContext jaxb = JAXBContext.newInstance(xacmlPath);
                    Unmarshaller un = jaxb.createUnmarshaller();
                    un.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
                    JAXBElement<RequestType> jaxbRequestType = (JAXBElement<RequestType>) un.unmarshal(DocumentUtil
                            .getNodeAsStream(xacmlRequest));
                    RequestType req = jaxbRequestType.getValue();
                    xacmlQuery.setRequest(req);
                } catch (Exception e) {
                    throw logger.parserException(e);
                }
            }
        }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.protocol.XACMLAuthzDecisionQueryType

    public Result send(String endpoint, String issuer, RequestType xacmlRequest) throws ProcessingException, SOAPException,
            ParsingException {
        try {
            String id = IDGenerator.create("ID_");

            XACMLAuthzDecisionQueryType queryType = new XACMLAuthzDecisionQueryType(id, XMLTimeUtil.getIssueInstant());

            queryType.setRequest(xacmlRequest);

            // Create Issuer
            NameIDType nameIDType = new NameIDType();
            nameIDType.setValue(issuer);
            queryType.setIssuer(nameIDType);

            SOAPMessage soapMessage = SOAPUtil.create();

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            XMLStreamWriter xmlStreamWriter = StaxUtil.getXMLStreamWriter(baos);
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.