use of org.apache.cxf.rt.security.saml.xacml.CXFMessageParser in project cxf by apache.
the class DefaultXACMLRequestBuilder method createRequest.
/**
* Create an XACML Request given a Principal, list of roles and Message.
*/
public RequestType createRequest(Principal principal, List<String> roles, Message message) throws Exception {
CXFMessageParser messageParser = new CXFMessageParser(message);
String issuer = messageParser.getIssuer();
String actionToUse = messageParser.getAction(action);
SubjectType subjectType = createSubjectType(principal, roles, issuer);
ResourceType resourceType = createResourceType(messageParser);
AttributeType actionAttribute = createAttribute(XACMLConstants.ACTION_ID, XACMLConstants.XS_STRING, null, actionToUse);
ActionType actionType = RequestComponentBuilder.createActionType(Collections.singletonList(actionAttribute));
return RequestComponentBuilder.createRequestType(Collections.singletonList(subjectType), Collections.singletonList(resourceType), actionType, createEnvironmentType());
}
Aggregations