Class DefaultXACMLRequestBuilder
- java.lang.Object
-
- org.apache.cxf.rt.security.saml.xacml2.DefaultXACMLRequestBuilder
-
- All Implemented Interfaces:
XACMLRequestBuilder
public class DefaultXACMLRequestBuilder extends Object implements XACMLRequestBuilder
This class constructs an XACML 2.0 Request given a Principal, list of roles and MessageContext, following the SAML 2.0 profile of XACML 2.0. The principal name is inserted as the Subject ID, and the list of roles associated with that principal are inserted as Subject roles. The current DateTime is also sent in an Environment, however this can be disabled via configuration. For a SOAP Service, the resource-id Attribute refers to the "{serviceNamespace}serviceName#{operationNamespace}operationName" String (shortened to "{serviceNamespace}serviceName#operationName" if the namespaces are identical). The "{serviceNamespace}serviceName", "{operationNamespace}operationName" and resource URI are also sent to simplify processing at the PDP side. The action to send defaults to "execute". For a REST service the request URL is the resource. You can also configure the ability to send the truncated request URI instead for a SOAP or REST service. The action to send defaults to the HTTP verb.
-
-
Constructor Summary
Constructors Constructor Description DefaultXACMLRequestBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.opensaml.xacml.ctx.RequestTypecreateRequest(Principal principal, List<String> roles, org.apache.cxf.message.Message message)Create an XACML Request given a Principal, list of roles and Message.voidsetAction(String action)Set a new Action String to usevoidsetSendDateTime(boolean sendDateTime)voidsetSendFullRequestURL(boolean sendFullRequestURL)Whether to send the full Request URL as the resource or not.
-
-
-
Method Detail
-
createRequest
public org.opensaml.xacml.ctx.RequestType createRequest(Principal principal, List<String> roles, org.apache.cxf.message.Message message) throws Exception
Create an XACML Request given a Principal, list of roles and Message.- Specified by:
createRequestin interfaceXACMLRequestBuilder- Parameters:
principal- The principal to insert into the Subject of the Requestroles- The list of roles associated with the principalmessage- The Message from which to retrieve the resource- Returns:
- An OpenSAML RequestType object
- Throws:
Exception
-
setAction
public void setAction(String action)
Set a new Action String to use
-
setSendDateTime
public void setSendDateTime(boolean sendDateTime)
-
setSendFullRequestURL
public void setSendFullRequestURL(boolean sendFullRequestURL)
Whether to send the full Request URL as the resource or not. If set to true, the full Request URL will be sent for both a JAX-WS and JAX-RS service. If set to false (the default), a JAX-WS service will send the "{namespace}operation" QName, and a JAX-RS service will send the RequestURI (i.e. minus the initial https:prefix).
-
-