Examples of XACMLAuthzDecisionStatementType


Examples of org.picketlink.identity.federation.saml.v2.profiles.xacml.assertion.XACMLAuthzDecisionStatementType

            SAMLResponseParser samlResponseParser = new SAMLResponseParser();
            ResponseType responseType = (ResponseType) samlResponseParser.parse(xmlEventReader);

            // ResponseType responseType = (ResponseType) response;
            AssertionType at = responseType.getAssertions().get(0).getAssertion();
            XACMLAuthzDecisionStatementType xst = (XACMLAuthzDecisionStatementType) at.getStatements().iterator().next();
            ResultType rt = xst.getResponse().getResult().get(0);
            DecisionType dt = rt.getDecision();

            return new Result(dt, null);
        } catch (IOException e) {
            throw logger.processingError(e);
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.profiles.xacml.assertion.XACMLAuthzDecisionStatementType

        SOAPMessage soapMessage = SOAPUtil.getSOAP12Message(bis);

        soapMessage.writeTo(System.out);

        Node xacmlNode = soapMessage.getSOAPBody().getChildNodes().item(0);
        XACMLAuthzDecisionStatementType xacmlStatement = SOAPSAMLXACMLUtil.getDecisionStatement(xacmlNode);
        assertNotNull(xacmlStatement);
    }
View Full Code Here

Examples of org.picketlink.identity.federation.saml.v2.profiles.xacml.assertion.XACMLAuthzDecisionStatementType

        ByteArrayInputStream bis = new ByteArrayInputStream(baos.toByteArray());

        SOAPMessage soapMessage = SOAPUtil.getSOAPMessage(bis);

        Node xacmlNode = soapMessage.getSOAPBody().getChildNodes().item(0);
        XACMLAuthzDecisionStatementType xacmlStatement = SOAPSAMLXACMLUtil.getDecisionStatement(xacmlNode);
        /*
         * Unmarshaller un = JAXBUtil.getUnmarshaller(SOAPSAMLXACMLUtil.getPackage()); JAXBElement<Envelope> jax =
         * (JAXBElement<Envelope>) un.unmarshal(bis); Envelope envelope = jax.getValue(); assertNotNull("Envelope is not null",
         * envelope);
         *
         * JAXBElement<ResponseType> jaxbResponseType = (JAXBElement<ResponseType>) envelope.getBody().getAny().get(0);
         * ResponseType responseType = jaxbResponseType.getValue();
         *
         * assertNotNull("ResponseType is not null", responseType); AssertionType assertion = (AssertionType)
         * responseType.getAssertionOrEncryptedAssertion().get(0); XACMLAuthzDecisionStatementType xacmlStatement =
         * (XACMLAuthzDecisionStatementType) assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().get(0);
         */

        assertNotNull("XACML Authorization Statement is not null", xacmlStatement);
        org.jboss.security.xacml.core.model.context.ResponseType xacmlResponse = xacmlStatement.getResponse();
        ResultType resultType = xacmlResponse.getResult().get(0);
        DecisionType decision = resultType.getDecision();
        assertNotNull("Decision is not null", decision);
        assertEquals(value, decision.value());
    }
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.