Previous Topic: Manage Password State

Next Topic: Update Realms with a New Authentication Scheme

Create Responses and Response Attributes

The following script creates a response and response attribute. Note that GetAgentType() needs to be called to retrieve an agent type object for the call to CreateResponse():

use Netegrity::PolicyMgtAPI;

$policyapi = Netegrity::PolicyMgtAPI‑>New();
$session = $policyapi‑>CreateSession("adminid", "adminpwd");

$domain = $session‑>GetDomain("Acme North Domain");
$agenttype=$session‑>GetAgentType("Web Agent");
$response=$domain‑>CreateResponse("Welcome to Payroll",$agenttype);
if ($response==undef) {
   print "\nCouldn't create the response.";
}
else {
   $attr=$response‑>CreateAttribute("WebAgent-HTTP-Cookie-Variable",
                                    "cookiename=mycookie");
   if ($attr==undef) {
      print "\nCouldn't create attribute for ".$response‑>Name();
   }
   else {
      print "\nCreated response " . $response‑>Name();
      print "\nCreated attribute " . $attr‑>GetValue();
   }
}


Copyright © 2010 CA. All rights reserved. Email CA about this topic