Search in sources :

Example 6 with Request

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));
}
Also used : Response(com.sun.identity.xacml.context.Response) SSOToken(com.iplanet.sso.SSOToken) Request(com.sun.identity.xacml.context.Request) Parameters(org.testng.annotations.Parameters) Test(org.testng.annotations.Test)

Aggregations

Request (com.sun.identity.xacml.context.Request)6 Attribute (com.sun.identity.xacml.context.Attribute)4 Resource (com.sun.identity.xacml.context.Resource)4 Response (com.sun.identity.xacml.context.Response)4 URI (java.net.URI)4 ArrayList (java.util.ArrayList)4 Action (com.sun.identity.xacml.context.Action)3 Environment (com.sun.identity.xacml.context.Environment)3 Subject (com.sun.identity.xacml.context.Subject)3 List (java.util.List)3 SSOToken (com.iplanet.sso.SSOToken)2 XACMLException (com.sun.identity.xacml.common.XACMLException)2 Decision (com.sun.identity.xacml.context.Decision)2 Result (com.sun.identity.xacml.context.Result)2 SSOException (com.iplanet.sso.SSOException)1 PolicyEvaluator (com.sun.identity.policy.PolicyEvaluator)1 PolicyException (com.sun.identity.policy.PolicyException)1 ResourceResult (com.sun.identity.policy.ResourceResult)1 SAML2Exception (com.sun.identity.saml2.common.SAML2Exception)1 Status (com.sun.identity.xacml.context.Status)1