use of com.sun.identity.xacml.context.Request in project OpenAM by OpenRock.
the class XACMLRequestProcessorTest method testProcessRequest.
@Test(groups = { "xacml" })
@Parameters({ "pdp.entityId", "pep.entityId", "login.id", "login.password", "subject.id", "subject.id.datatype", "subject.category", "resource.id", "resource.id.datatype", "resource.servicename", "resource.servicename.datatype", "action.id", "action.id.datatype" })
public void testProcessRequest(String pdpEntityId, String pepEntityId, String loginId, String loginPassword, String subjectId, String subjectIdType, String subjectCategory, String resourceId, String resourceIdType, String serviceName, String serviceNameType, String actionId, String actionIdType) throws XACMLException, SAML2Exception, URISyntaxException, Exception {
if ((subjectId == null) || (subjectId.length() == 0)) {
SSOToken ssoToken = TokenUtils.getSessionToken("/", loginId, loginPassword);
subjectId = ssoToken.getTokenID().toString();
subjectIdType = XACMLConstants.OPENSSO_SESSION_ID;
}
Request xacmlRequest = createSampleXacmlRequest(subjectId, subjectIdType, subjectCategory, resourceId, resourceIdType, serviceName, serviceNameType, actionId, actionIdType);
log(Level.INFO, "testProcessRequest():xacmlRequest:\n", xacmlRequest.toXMLString(true, true));
Response xacmlResponse = XACMLRequestProcessor.getInstance().processRequest(xacmlRequest, pdpEntityId, pepEntityId);
log(Level.INFO, "testProcessRequest():xacmlResponse:\n", xacmlResponse.toXMLString(true, true));
}
Aggregations