Java Code Examples for org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType#setReturnContext()

The following examples show how to use org.opensaml.xacml.profile.saml.XACMLAuthzDecisionQueryType#setReturnContext() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XACMLAuthzDecisionQueryTypeUnmarshaller.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/** {@inheritDoc} */
protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException {
    XACMLAuthzDecisionQueryType authzDS = (XACMLAuthzDecisionQueryType) samlObject;

    if (attribute.getLocalName().equals(XACMLAuthzDecisionQueryType.INPUTCONTEXTONLY_ATTRIB_NAME)) {
        authzDS.setInputContextOnly(XSBooleanValue.valueOf(attribute.getValue()));
    }

    if (attribute.getLocalName().equals(XACMLAuthzDecisionQueryType.RETURNCONTEXT_ATTRIB_NAME)) {
        authzDS.setReturnContext(XSBooleanValue.valueOf(attribute.getValue()));
    }

    if (attribute.getLocalName().equals(XACMLAuthzDecisionQueryType.COMBINEPOLICIES_ATTRIB_NAME)) {
        authzDS.setCombinePolicies(XSBooleanValue.valueOf(attribute.getValue()));
    }

    super.processAttribute(samlObject, attribute);
}
 
Example 2
Source File: SamlRequestComponentBuilder.java    From cxf with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
public static XACMLAuthzDecisionQueryType createAuthzDecisionQuery(
    boolean inputContextOnly,
    boolean returnContext,
    String issuerValue,
    RequestType request,
    String namespace
) {
    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;
}