Symantec Access Management

 View Only
  • 1.  CLI to get authscheme name of a realm

    Posted Jun 15, 2019 03:00 AM
    Trying to write a perl script to retrieve the authscheme of each realm in each domain:
    # Policy Server info
    use Netegrity::PolicyMgtAPI;
    $policyapi = Netegrity::PolicyMgtAPI->New();
    $session = $policyapi->CreateSession("siteminder","xxxxxxx");
    if ($session == undef) {
    print "Failed to connect to policy server\n";
    exit;
    }

    print " Connected to policy server successfully\n";


    print "\n\n******************************************\n\n";

    @domains = $session->GetAllDomains();
    open(FILE,">$ARGV[0]");

    print FILE "Domain Names, Realm Names\n";

    foreach $domain(@domains) {
    #print FILE $domain->Name()."\n";
    #print FILE $domain->Name().",";
    print "Domain Name\n\n";

    @realms=$domain->GetAllRealms();
    foreach $realm(@realms) {
    #print FILE ",";
    print FILE $domain->Name().",";
    print FILE $realm->Name().",";
    print FILE $realm->AuthScheme().",";


    Output:
    Domainname1,realmname1,Netegrity::PolicyMgtAuthScheme=SCALAR(xxxxxxx),
    Domainname1,realmname1,Netegrity::PolicyMgtAuthScheme=SCALAR(0x1bcf5c8),
    Domainname1,realmname1,Netegrity::PolicyMgtAuthScheme=SCALAR(0x1bcf5c8),

    How can i get to print the authscheme name instead in the output?

    Thanks


  • 2.  RE: CLI to get authscheme name of a realm
    Best Answer

    Posted Jul 08, 2019 04:01 PM
    Here is what we use to print some realm info...

    ## Loop thru realms for this domain...
    @realms=$domain->GetAllRealms();
    foreach $realm(@realms) {
    $ascheme=$realm->AuthScheme();
    print FILE "\n" . $domain->Name() . "," . $realm->Name() . "," . $realm->ResourceFilter() . "," . $realm->ProtectResource() . "," . $realm->Description() . "," . $ascheme->Name() . "," . $ascheme->CustomParam();
    }