String serviceName = "iPlanetAMWebAgentService";
String action = "POST";
SSOToken token = getSSOToken(subject);
try
{
debug.message("Authorizing access - SSOToken is "+token);
debug.message("Checking policy for "+action+" on URL "+appliesTo);
PolicyEvaluator pe = new PolicyEvaluator(serviceName);
debug.message("Got PolicyEvaluator for "+serviceName);
boolean isAllowed = pe.isAllowed(token, appliesTo, action);
debug.message("Access " + (isAllowed ? "is" : "is not" ) + " allowed");
return isAllowed;
}
catch ( PolicyException pe )
{
debug.error("Exception evaluating policy", pe);
}
catch ( SSOException ssoe )
{
debug.error("Exception evaluating policy", ssoe);
}
return false;