Previous Topic: Create Responses and Response Attributes

Next Topic: View Default Values for an Authentication Scheme Template

Update Realms with a New Authentication Scheme

The following example assigns the authentication scheme HTML Authentication to all the realms in the domain Acme North Domain:

use Netegrity::PolicyMgtAPI;

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

$domain = $session‑>GetDomain("Acme North Domain");
$authscheme=$session‑>GetAuthScheme("HTML Authentication");

@realms=$domain‑>GetAllRealms();
print "Updating these realms to auth scheme ".$authscheme‑>Name();
foreach $realm(@realms) {
   $name=$realm‑>Name();
   if ($realm‑>AuthScheme($authscheme)==undef) {
      print "\n  Couldn't update realm " . $name;
   }
   else {
      print "\n  Realm ". $name;
   }
}


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