認証方式の作成

認証方式を作成するときに、方式のベースとして認証方式テンプレートを使用します。そうするには、まず既存のテンプレートを取得し、次に、CreateAuthScheme() へのコールでテンプレート オブジェクトを指定します。
casso1283
認証方式を作成するときに、方式のベースとして認証方式テンプレートを使用します。そうするには、まず既存のテンプレートを取得し、次に、CreateAuthScheme() へのコールでテンプレート オブジェクトを指定します。
以下の例は、テンプレート[HTML フォーム テンプレート]に基づいて認証方式を作成し、デフォルトをすべて受け入れます。
use Netegrity::PolicyMgtAPI;
$policyapi = Netegrity::PolicyMgtAPI->New();
$session = $policyapi->CreateSession("adminid", "adminpwd");
#Retrieve the object for the authentication scheme template
$template=$session->GetAuthScheme("HTML Form Template");
#Create the authentication scheme
$scheme=$session->CreateAuthScheme("HTML Authentication",$template);
if ($scheme == undef) {
   print "\nCouldn't create the authentication scheme.";
}
else {
   print "\nCreated authentication scheme ".$scheme->Name();
}