This section contains the following topics:
The following methods act on AgentAPI objects:
The AddServerConfig method adds one or more Policy Server configurations to the Agent API object. Before you can establish a connection between the Policy Server and the Agent API, you must call this method at least once.
Syntax
The AddServerConfig method has the following format:
Netegrity::AgentAPI‑>AddServerConfig(IPAddress[, minConn] [, maxConn][, stepConn][, timeout][, azPort][, auPort] [, acPort])
Parameters
The AddServerConfig method accepts the following parameters:
IPAddress (string)
Specifies the IP address of the Policy Server.
minConn (int)
(Optional) Specifies the minimum number of connections allowed.
maxConn (int)
(Optional) Specifies the maximum number of connections allowed.
stepConn (int)
(Optional) Specifies the number of connections to add when all existing connections are being used.
timeout (int)
(Optional) Specifies the time in seconds before the Agent API stops trying to connect to the Policy Server.
azPort (int)
(Optional) Specifies the port number for the authorization service.
auPort (int)
(Optional) Specifies the port number for the authentication service.
acPort (int)
(Optional) Specifies the port number for the accounting service.
Return Value
The AddServerConfig method returns the following value:
Remarks
The single-process Policy Server introduced in SiteMinder v6.0 combines the previously separate authentication, authorization, and accounting processes into one combined process whose requests go through one TCP port. As a result, the parameters azPort, auPort, and acPort all reference the same port number. The three arguments are maintained for backward compatibility.
The Connect method establishes a connection between the Agent API and the Policy Server.
Syntax
The Connect method has the following format:
Netegrity::AgentAPI‑>Connect([bootFile])
Parameters
The Connect method accepts the following parameter:
bootFile (string)
(Optional) Specifies the name of the configuration file to be used for connecting to a v5.x agent.
Note: You can use an existing file such as SmHost.conf or create a new file. For more information, see the method AgentAPI‑>CreateBootstrapFile.
Return Value
The Connect method returns one of the following values:
Specifies that the connection was successful.
Specifies that the Agent API could not reach the Policy Server.
Specifies that the method timed out.
Specifies that initialization failed.
The CreateBootstrapFile method generates a bootstrap file that the Policy Server can use for connecting to a v5.x agent. The bootstrap file contains the settings specified by the method's parameters. Once the connection is made, the Policy Server can provide the remaining settings. SmHost.conf is an example of a bootstrap file.
Syntax
The CreateBootstrapFile method has the following format:
Netegrity::AgentAPI‑>CreateBootstrapFile(trustedHostName, ipAddress, hostConfigName, sharedSecret, registrationDataFileName)
Parameters
The CreateBootstrapFile method accepts the following parameters:
trustedHostName (string)
Specifies the name of the trusted host.
ipAddress (string)
Specifies the IP address of the Policy Server.
hostConfigName (string)
Specifies the name of the host configuration object.
sharedSecret (string)
Specifies the value of the shared secret used by the host.
registrationDataFileName (string)
Specifies the name of the bootstrap file generated by the method.
Return Value
The CreateBootstrapFile method returns one of the following values:
Specifies the name of the newly-created file.
Specifies that the method failed.
Example
The following code fragment is an example of how to use the CreateBootstrapFile method:
# A shared secret is not specified in the context of a v5.x agent. # A v5.x agent by the specified name needs to exist in the policy # store. Use Netegrity::AgentAPI. $agentapi = Netegrity::AgentAPI‑>New($agentname); # Create the bootstrap file. $agentapi‑>CreateBootstrapFile($thostname, $ipaddr, $hconfname, $secret, $fname); # Notice that in the v5.x context, the connect() method takes a filename. $agentapi‑>Connect($fname);
The CreateUser method creates a user object containing the information passed to the method in the parameters. Perl uses this object to perform user operations, such as login.
Note: This method does not create a new user in the user directory.
Syntax
The CreateUser method has the following format:
Netegrity::AgentAPI‑>CreateUser(Username, Password[, cert][, certLength])
Parameters
The CreateUser method accepts the following parameters:
Username (string)
Specifies the user's ID.
Password (string)
Specifies the user's password.
cert (string)
(Optional) Specifies an X.509 certificate for user authentication.
certLength (int)
(Optional) Specifies the length of the certificate.
Return Value
The CreateUser method returns one of the following values:
Specifies that the method failed.
The Disconnect method closes the connection between the Agent and the Policy Server.
Syntax
The Disconnect method has the following format:
Netegrity::AgentAPI‑>Disconnect()
Parameters
The Disconnect method accepts no parameters.
Return Value
The Disconnect method returns one of the following values:
Specifies that the connection was closed successfully.
Specifies that the connection was not successfully closed.
The DoManagement method requests the list of Agent commands pending from the Policy Server and returns them in an array. To access the commands in the array, call the AgentResponseAttr‑>GetID method.
Syntax
The DoManagement method has the following format:
Netegrity::AgentAPI‑>DoManagement()
Parameters
The DoManagement method accepts no parameters.
Return Value
The DoManagement method returns one of the following values:
Specifies that there are no pending Agent commands.
The GetResource method retrieves the specified resource.
Syntax
The GetResource method has the following format:
Netegrity::AgentAPI‑>GetResource(resName[, action][, clientIP])
Parameters
The GetResource method accepts the following parameters:
resName (string)
Specifies the name of the resource to retrieve.
action (string)
(Optional) Specifies the HTTP action to perform (for example, GET, POST, or PUT).
clientIP (string)
(Optional) Specifies the client's IP address.
Return Value
The GetResource method returns the following value:
You can call the IncrementRefCount method when the Agent API is operating in multi-threaded mode. After calling the Perl function fork, for example, you can call this method within the child process.
Syntax
The IncrementRefCount method has the following format:
Netegrity::AgentAPI‑>IncrementRefCount()
Parameters
The IncrementRefCount method accepts no parameters.
Return Value
The IncrementRefCount method does not return a value.
The New method constructs the Agent API object and must be called before the Agent API object can be used.
Syntax
The New method has the following format:
Netegrity::AgentAPI‑>New(agentName[, sharedSecret][, failover])
Parameters
The New method accepts the following parameters:
pagentName (string)
Specifies the name of the agent as it appears in the policy store.
Note: The agent name is not case-sensitive.
psharedSecret (string)
(Optional) Specifies the shared secret as it appears in the policy store.
Note: If you provide a value for the shared secret, a v4.x agent object is created. If you do not provide a value for the shared secret, a v5.x agent object is created. The shared secret is case-sensitive.
failover (int)
(Optional) Specifies whether to enable or disable failover operation:
Specifies enabling failover operation.
Specifies disabling failover operation.
Return Value
The New method returns the following value:
The PrintDebugTrace method enables or disables the output of error or trace information to the console and returns the value of 1 or 0, respectively.
Syntax
The PrintDebugTrace method has the following format:
Netegrity::AgentAPI‑>PrintDebugTrace([debugFlag])
Parameters
The PrintDebugTrace method accepts the following parameter:
debugFlag (int)
(Optional) Specifies enabling or disabling output of error or trace information to the console:
Specifies enabling output.
Specifies disabling output.
Return Value
The PrintDebugTrace method returns one of the following integer values:
Specifies that output is enabled.
Specifies that output is disabled.
The ProcessAuthResponse method extracts pertinent information returned from a login or change password.
Syntax
The ProcessAuthResponse method has the following format:
Netegrity::AgentAPI‑>GetResource(UserCreds)
Parameters
The ProcessAuthResponse method accepts the following parameter:
UserCreds (UserCredentials)
Specifies the user credentials from a login or change password call
Return Value
The ProcessAuthResponse method returns the pertinent information as a string.
The SetErrorCallback method registers a user-defined Perl subroutine that processes SiteMinder error messages. If multiple subroutines are registered, SiteMinder calls the most recently registered subroutine.
Syntax
The SetErrorCallback method has the following format:
Netegrity::AgentAPI‑>SetErrorCallback(subref)
Parameters
The SetErrorCallback method accepts the following parameter:
subref (string)
Specifies the name of the Perl subroutine or a reference to the subroutine:
Example:
$agentapi‑>SetErrorCallback("CustomErrorHandler");
Example:
$agentapi‑>SetErrorCallback(\&CustomErrorHandler);
Return Value
The SetErrorCallback method returns one of the following integer values:
Specifies that registration was successful.
Specifies that registration failed.
The SetTraceCallback method registers a user-defined Perl subroutine that processes SiteMinder trace messages. If multiple subroutines are registered, SiteMinder calls the most recently registered subroutine.
Syntax
The SetTraceCallback method has the following format:
Netegrity::AgentAPI‑>SetTraceCallback(subref[, mode][, delim] [, configFileName])
Parameters
The SetTraceCallback method accepts the following parameters:
subref (string)
Specifies the name of the Perl subroutine or a reference to the subroutine:
Example:
$agentapi‑>SetErrorCallback("CustomTraceHandler");
Example:
$agentapi‑>SetErrorCallback(\&CustomTraceHandler);
mode (string)
(Optional) Specifies an output format for the trace messages:
Specifies fields enclosed by square brackets.
Specifies fixed-width fields.
Specifies using a character to delimit the fields.
Specifies fields enclosed by XML-like tags.
delim (string)
(Optional) Specifies the character to use as a delimiter when mode is set to delim.
configFileName (string)
(Optional) Specifies the name of the configuration file that specifies the data to be included in the trace.
Default: If no filename is specified, default settings are used.
Return Value
The SetTraceCallback method returns one of the following integer values:
Specifies that registration was successful.
Specifies that registration failed.
The following methods act on AgentResource objects:
The GetAuthType method retrieves the type of credentials required for successful login to the resource or realm.
Syntax
The GetAuthType method has the following format:
Netegrity::AgentResource‑>GetAuthType()
Parameters
The GetAuthType method accepts no parameters.
Return Value
The GetAuthType method returns one of the following values:
Specifies that no credentials are required.
Note: This authorization type is used for anonymous realms.
Specifies that a username and password are required.
Specifies that the username and password must be exchanged using the digest protocol.
Specifies that a full X.509 client certificate is required.
Specifies that the user DN from an X.509 client certificate is required.
Specifies that the issuer DN from an X.509 client certificate is required.
Specifies that a certificate is required, if available.
Note: If a certificate is not available, a username and password are required.
Specifies that the username and password must be exchanged using the NT challenge/response protocol.
Specifies that either an X.509 certificate or a forms-based authentication scheme is required.
Specifies that an SSL connection is required.
Specifies that the user must be redirected to an HTML form.
Specifies that the credentials can be saved for 30 days
Note: When credentials are saved, users are not required to re-enter them each time they access a protected resource.
Specifies that the Session ID be preserved for as long as the current session is valid.
Specifies that the user not be challenged for credentials.
Specifies that the resource is not protected.
The IsProtected method checks whether SiteMinder is protecting the defined resource.
Syntax
The IsProtected method has the following format:
Netegrity::AgentResource‑>IsProtected()
Parameters
The IsProtected method accepts no parameters.
Return Value
The IsProtected method returns one of the following values:
Specifies that the resource is protected.
Specifies that the resource is not protected.
Specifies that the Policy Server could not be reached.
Specifies that the method timed out.
Specifies that initialization failed.
The following methods act on AgentResponse objects:
The GetAttributes method retrieves the list of available response attributes and returns them in an array. Use this method after successful calls to AgentUser‑>Login or AgentUser‑>GetResponse. To identify the types of response attributes in the array, call the AgentResponseAttr‑>GetID method.
Syntax
The GetAttributes method has the following format:
Netegrity::AgentResponse‑>GetAttributes()
Parameters
The GetAttributes method accepts no parameters.
Return Value
The GetAttributes method returns one of the following values:
Specifies that the method failed.
The GetSession method retrieves the session object from the response.
Syntax
The GetSession method has the following format:
Netegrity::AgentResponse‑>GetSession()
Parameters
The GetSession method accepts no parameters.
Return Value
The GetSession method returns one of the following values:
Specifies that the method failed.
The following methods act on AgentResponseAttr objects:
The GetFlags method retrieves the response attribute's flags.
Syntax
The GetFlags method has the following format:
Netegrity::AgentResponseAttr‑>GetFlags()
Parameters
The GetFlags method accepts no parameters.
Return Value
The GetFlags method returns the following value:
The GetID method retrieves a response attribute ID or an agent command ID.
Syntax
The GetID method has the following format:
Netegrity::AgentResponseAttr‑>GetID()
Parameters
The GetID method accepts no parameters.
Return Value
The GetID method returns a response attribute ID after AgentResponse‑>GetAttributes is called or an agent command ID after AgentAPI‑>DoManagement is called. In either case, the return value's type is long.
Specifies the internal SiteMinder object ID for the user directory where the user was authenticated.
Specifies the user's universal ID.
Specifies the user's identity ticket.
Note: This value is returned if user tracking is enabled.
Specifies the maximum time in minutes, during which actual session data is validated against session data stored in a cookie.
Specifies the directory name as it appears in the Name field of the SiteMinder User Directory dialog.
Specifies the server specification as it appears in the Server field of the SiteMinder User Directory dialog.
Specifies the user directory's namespace: LDAP, AD, WinNT, or ODBC.
Specifies the text presented to the user following an authentication attempt.
Note: This text could be an authentication challenge or a reason why authentication failed.
Specifies the user's distinguished name.
Instructs the agent to update the name of the affiliate agent.
Instructs the agent to update its "next" agent key.
Note: The encrypted value contains 24 bytes of binary data.
Instructs the agent to update its "last" agent key.
Note: The encrypted value contains 24 bytes of binary data.
Instructs the agent to update its "current" agent key.
Note: The encrypted value contains 24 bytes of binary data.
Instructs the agent to update its static (persistent) agent key.
Note: The encrypted value contains 24 bytes of binary data.
Instructs the agent to flush all information in its caches.
Instructs the agent to flush all user information stored in its caches.
Instructs the agent to flush all cache information for a given user.
Instructs the agent to flush all resource information stored in its caches.
Instructs the agent to flush all resource information for a given realm.
The GetName method retrieves the name of the response attribute.
Syntax
The GetName method has the following format:
Netegrity::AgentResponseAttr‑>GetName()
Parameters
The GetName method accepts no parameters.
Return Value
The GetName method returns the following value:
The GetTTL method retrieves the response attribute's Time To Live (TTL) value.
Syntax
The GetTTL method has the following format:
Netegrity::AgentResponseAttr‑>GetTTL()
Parameters
The GetTTL method accepts no parameters.
Return Value
The GetTTL method returns the following value:
The GetValue method retrieves the response attribute's value.
Syntax
The GetValue method has the following format:
Netegrity::AgentResponseAttr‑>GetValue()
Parameters
The GetValue method accepts no parameters.
Return Value
The GetValue method returns the following value:
The following method acts on AgentSvrCfg objects:
The IPAddress method sets or retrieves the IP address of the Policy Server.
Syntax
The IPAddress method has the following format:
Netegrity::AgentSvrCfg‑>IPAddress([IPAddress])
Parameters
The IPAddress method accepts the following parameter:
IPAddress (string)
(Optional) Specifies the IP address of the Policy Server.
Return Value
The IPAddress method returns the following value:
Specifies the IP address of the Policy Server.
The following methods act on AgentSession objects:
The AddParameter method adds a session variable name-value pair to a parameters list. Session variables contain data about the client application, such as business logic, certificate information, and SAML assertions for Affiliate applications. This data is bound to a user session.
Syntax
The AddParameter method has the following format:
Netegrity::AgentSession‑>AddParameter(varName [,varValue][, varFlag])
Parameters
The AddParameter method accepts the following parameters:
varName (string)
Specifies the name of the variable to add to the parameter list.
Limit: Maximum length is 255 characters.
varValue (string)
(Optional) Specifies the value of the variable to be added to the parameter list.
Limit: Maximum length is determined by the target data store.
varFlag (int)
(Optional) Specifies whether the GetVariables method deletes the variable name-value pair from the session store:
Specifies that GetVariables retrieves the variable name-value pair from the session store, but does not delete it.
Specifies that GetVariables retrieves the variable name-value pair from the session store and then deletes it.
Return Value
The AddParameter method does not return a value.
Remarks
You can manage the name-value pairs in the parameters list by calling these session variable methods:
To manage multiple variables, call AddParameter once for each variable before calling the AgentSession‑>DelVariables, AgentSession‑>GetVariables, and AgentSession‑>SetVariables methods. While AddParameter adds variables to the parameters list, AgentSession‑>DelVariables, AgentSession‑>GetVariables, and AgentSession‑>SetVariables clear the parameters list.
Before you can use the session variable methods, the following conditions must be met:
Note: For more information, see the Policy Server Administration Guide and the Policy Server Configuration Guide.
The DelVariables method deletes the session variables in the parameters list from the session store. Call AgentSession‑>AddParameter first to specify the variables in the parameters list.
Syntax
The DelVariables method has the following format:
Netegrity::AgentSession‑>DelVariables()
Parameters
The DelVariables method accepts no parameters.
Return Value
The DelVariables method does not return a value.
Remarks
The DelVariables method clears the parameters list.
The GetID method retrieves the session ID.
Syntax
The GetID method has the following format:
Netegrity::AgentSession‑>GetID()
Parameters
The GetID method accepts no parameters.
Return Value
The GetID method returns the following value:
The GetReason method retrieves the session's reason ID. The reason ID specifies a reason for a failed authentication or authorization.
Syntax
The GetReason method has the following format:
Netegrity::AgentSession‑>GetReason()
Parameters
The GetReason method accepts no parameters.
Return Value
The GetReason method returns one of the following values (long):
The GetSpec method retrieves the encrypted session specification. The session specification includes information about the user session, such as the session start time, timeout parameters, and the user's distinguished name. You can use the session specification to identify a session across multiple Web sites, as you would for single sign-on applications.
Syntax
The GetSpec method has the following format:
Netegrity::AgentSession‑>GetSpec()
Parameters
The GetSpec method accepts no parameters.
Return Value
The GetSpec method returns the following value:
Remarks
Where the session specification is stored depends on the type of session:
The session specification is stored in a cookie.
The session specification is stored in a session store database and optionally in a cookie on the client.
Note: The session ticket is used as an index to the actual user session data stored in the Web agent's cache.
The GetVariables method retrieves the session variables in the parameters list from the session store. Call AgentSession‑>AddParameter first to specify the variables in the parameters list. To delete a variable from the session store after it is retrieved, call AgentSession‑>AddParameter with varFlag set to 1 (one).
Syntax
The GetVariables method has the following format:
Netegrity::AgentSession‑>GetVariables()
Parameters
The GetVariables method accepts no parameters.
Return Value
The GetVariables method returns the following value:
Note: Some session variables cannot be retrieved. To check for these, call AgentResponseAttr‑>GetFlags for the associated AgentResponseAttr object and test for the following return value:
SM_AGENTAPI_RESPATTR_FLAGS_UNRESOLVED (value = 2)
Remarks
The GetVariables method clears the parameters list.
The IdleTimeout method retrieves the session's idle timeout value in seconds. The idle timeout value is the maximum length of time a user session can be inactive. When this time is exceeded, the session is no longer valid and the user must re-authenticate.
Syntax
The IdleTimeout method has the following format:
Netegrity::AgentSession‑>IdleTimeout()
Parameters
The IdleTimeout method accepts no parameters.
Return Value
The IdleTimeout method returns the following value:
The MaxTimeout method retrieves the session's maximum timeout value in seconds. The maximum timeout value is the length of time a user session can be active. When this time is exceeded, the user must re-authenticate.
Syntax
The MaxTimeout method has the following format:
Netegrity::AgentSession‑>MaxTimeout()
Parameters
The MaxTimeout method accepts no parameters.
Return Value
The MaxTimeout method returns the following value:
The SetVariables method writes the session variables in the parameters list to the session store. Call AgentSession‑>AddParameter first to specify the variables in the list. If a variable exists in the session store, its value is updated to the new value. If the variable does not exist, a new variable is created.
Syntax
The SetVariables method has the following format:
Netegrity::AgentSession‑>SetVariables()
Parameters
The SetVariables method accepts no parameters.
Return Value
The SetVariables method does not return a value.
Remarks
The SetVariables method clears the parameters list.
The following methods act on SSOToken objects:
The Decode method decodes a single sign-on token and returns a subset of its attributes. In addition, you have the option of updating the token's last-accessed timestamp by passing a non-zero value to this method. To retrieve the updated token in string format, call SSOToken‑>GetString and write the token string to the SMSESSION cookie.
Syntax
The Decode method has the following format:
Netegrity::SSOToken‑>Decode([update])
Parameters
The Decode method accepts the following parameter:
update (int)
(Optional) Specifies whether an updated token is requested:
Specifies that an updated token is requested.
Specifies that an updated token is not requested.
Return Value
The Decode method returns one of the following values:
Specifies the IP address of the machine where the user initiated a request for a protected resource.
Specifies the name of the agent that is decoding the token.
Specifies the maximum idle time for a session.
Specifies the time when the Policy Server was last accessed within the session.
Specifies the maximum time that a session can be active.
Specifies the session ID returned from the login call.
Specifies the session specification returned from the login call.
Specifies when the session started after a successful login.
Specifies the user's distinguished name.
Specifies the user's name.
Specifies that the method failed.
Remarks
To create a single sign-on object, call AgentUser‑>CreateSSOToken.
The GetString method retrieves the string representation of a single sign-on token object. After calling GetString, you can write the token string to the SMSESSION cookie.
Syntax
The GetString method has the following format:
Netegrity::SSOToken‑>GetString()
Parameters
The GetString method accepts no parameters.
Return Value
The GetString method returns the following value:
Remarks
You can call GetString after creating a single sign-on token object with CreateSSOToken. You can also call GetString after updating the token's last-accessed timestamp with Decode.
The GetVersion method retrieves the SiteMinder version of the single sign-on token.
Syntax
The GetVersion method has the following format:
Netegrity::SSOToken‑>GetVersion()
Parameters
The GetVersion method accepts no parameters.
Return Value
The GetVersion method returns the following value:
Specifies the SiteMinder version of the single sign-on token.
The IsThirdParty method determines whether the token was originally produced by a custom (or third-party) agent and has not yet been updated by a standard SiteMinder agent.
Syntax
The IsThirdParty method has the following format:
Netegrity::SSOToken‑>IsThirdParty()
Parameters
The IsThirdParty method accepts no parameters.
Return Value
The IsThirdParty method returns one of the following integer values:
Specifies that the token was originally produced by a custom agent and has not yet been updated by a standard SiteMinder agent.
Specifies that the token was not produced by a custom agent or has been updated by a standard SiteMinder agent.
The following methods act on AgentUser objects:
The Audit method audits authorizations performed out of the agent cache.
Syntax
The Audit method has the following format:
Netegrity::AgentUser‑>Audit()
Parameters
The Audit method accepts no parameters.
Return Value
The Audit method returns one of the following values:
Specifies that the audit was successful.
Specifies that the audit was not successful.
Specifies that the Policy Server could not be reached.
Specifies that the method timed out.
Specifies that initialization failed.
The Certificate method sets or retrieves the user's X.509 certificate. This method only affects the certificate data associated with the current instance of the user object.
Syntax
The Certificate method has the following format:
Netegrity::AgentUser‑>Certificate([cert, certBinaryLen])
Parameters
The Certificate method accepts the following parameters:
cert (string)
(Optional) Specifies the certificate data to set.
certBinaryLen (int)
(Optional) Specifies the length of the certificate.
Return Value
The Certificate method returns one of the following values:
Specifies the new or existing certificate's data and length.
Specifies that the method failed.
The CertificateFile method sets or retrieves the user's X.509 certificate using the specified certificate file.
Syntax
The CertificateFile method has the following format:
Netegrity::AgentUser‑>CertificateFile([certFile[, format]])
Parameters
The CertificateFile method accepts the following parameters:
certFile (string)
(Optional) Specifies the full path and file name of the certificate file.
format (string)
(Optional) Specifies the format of the certificate file.
Default: base64 encoded X.509 (value = 1)
Note: The default is the only supported file format.
Return Value
The CertificateFile method returns the following value:
Specifies the new or existing certificate's data and length.
The CreateSSOToken method creates a single sign-on token object from a valid user session. The token contains encrypted session and other information that a custom agent can share with a standard SiteMinder Web agent. Creating single sign-on between standard and custom agents requires that the agents be in the same domain. To create the single sign-on object, the user must be logged in to the custom agent, not the SiteMinder agent.
Syntax
The CreateSSOToken method has the following format:
Netegrity::AgentUser‑>CreateSSOToken(szDn, szName, szIP)
Parameters
The CreateSSOToken method accepts the following parameters:
szDn (string)
Specifies the user's distinguished name.
szName (string)
Specifies the user's name.
szIP (string)
Specifies the IP address of the machine, where the user initiates the request for a protected resource.
Return Value
The CreateSSOToken method returns the following value:
Remarks
To retrieve the token object in string format, use the GetString method and write the token string to the SMSESSION cookie. To decode the token and retrieve a subset of its attributes, use the Decode method.
The CustomData method sets or retrieves custom authentication data. This method is used to test authentication schemes that are based on the Custom Template. The format and content of custom authentication data are customer-defined according to the requirements of each Web site.
Syntax
The CustomData method has the following format:
Netegrity::AgentUser‑>CustomData([customData, length])
Parameters
The CustomData method accepts the following parameters:
customData (string)
(Optional) Specifies the custom authentication data to set.
length (int)
(Optional) Specifies the length of the custom authentication data.
Return Value
The CustomData method returns one of the following values:
Specifies the new or existing custom authentication data and length.
Specifies that the method failed.
The FormData method sets or retrieves HTML forms-based authentication data. This method is used to test authentication schemes that are based on the HTML Forms Template. The formData string consists of attribute name-value pairs separated by the ampersand (&) character.
Example:
"PASSWORD=$password1&email=$username1@mycompany.com"
Syntax
The FormData method has the following format:
Netegrity::AgentUser‑>FormData([formData])
Parameters
The FormData method accepts the following parameter:
formData (string)
(Optional) Specifies the HTML forms-based authentication data to set.
Return Value
The FormData method returns one of the following values:
Specifies the new or existing HTML forms-based authentication data.
Specifies that the method failed.
The GetResponse method returns a response after AgentUser‑>IsAuthorized or AgentUser‑>Login is called regardless of whether the user is authorized.
Syntax
The GetResponse method has the following format:
Netegrity::AgentUser‑>GetResponse()
Parameters
The GetResponse method accepts no parameters.
Return Value
The GetResponse method returns one of the following values:
Specifies that the method failed, because neither AgentUser‑>IsAuthorized or AgentUser‑>Login was called before calling GetResponse.
The Impersonate method allows one user to impersonate another user by logging in as that user. For example, a customer service representative can impersonate a customer to better understand a software problem that the customer is having.
Syntax
The Impersonate method has the following format:
Netegrity::AgentUser‑>Impersonate(username, resource)
Parameters
The Impersonate method accepts the following parameters:
username (string)
Specifies the ID of the user to impersonate.
resource (AgentResource object)
Specifies the resource to log in to.
Return Value
The Impersonate method returns one of the following values:
Specifies that the impersonation was successful.
Specifies that impersonation failed.
Specifies that the operation failed.
Specifies that the method timed out.
Specifies that initialization failed.
Remarks
The Impersonate method creates a new session without destroying the impersonator's original session. To end the impersonation session and restore the impersonator's original session, call AgentUser‑>Logout.
Only one user at a time can be impersonated. You cannot chain impersonation sessions.
Impersonation begins in a realm that is protected by the Impersonation Authorization Scheme. The impersonator must be authorized to impersonate users in the realm, and the user must be allowed to be impersonated in the realm.
For more information about user impersonation, see the Policy Server Configuration Guide.
The IsAuthorized method determines whether the user is authorized to perform the specified action on the specified resource. This method calls AgentUser‑>Login, if AgentUser‑>Login has not been called. After calling this method, call AgentUser‑>GetResponse.
Syntax
The IsAuthorized method has the following format:
Netegrity::AgentUser‑>IsAuthorized(resource[, clientIP][, transID])
Parameters
The IsAuthorized method accepts the following parameters:
resource (AgentResource object)
Specifies the resource to check.
clientIP (string)
(Optional) Specifies the client's IP address.
transID (string)
(Optional) Specifies the user-defined transaction ID that the agent uses to associate application activity with security activity.
Return Value
The IsAuthorized method returns one of the following values:
Specifies that the user is authorized.
Specifies that the user is not authorized.
Specifies that the Policy Server could not be reached.
Specifies that the method timed out.
Specifies that initialization was not done.
The IsAuthorizedEx method determines whether the user is authorized to perform the specified action on the specified resource. This method calls AgentUser‑>Login if AgentUser‑>Login has not been called. After calling this method, call AgentUser‑>GetResponse.
Syntax
The IsAuthorizedEx method has the following format:
Netegrity::AgentUser‑>IsAuthorizedEx(resource[, clientIP][, transID])
Parameters
The IsAuthorizedEx method accepts the following parameters:
resource (AgentResource object)
Specifies the resource to check.
clientIP (string)
(Optional) Specifies the client's IP address.
transID (string)
(Optional) Specifies the user-defined transaction ID that the agent uses to associate application activity with security activity.
Return Value
The IsAuthorizedEx method returns one of the following values:
Specifies that the user is authorized.
Specifies that the user is not authorized.
Specifies that the Policy Server could not be reached.
Specifies that the method timed out.
Specifies that initialization was not done.
The Login method performs session login and validation. Before calling this method, call AgentResource‑>IsProtected for the target resource.
Syntax
The Login method has the following format:
Netegrity::AgentUser‑>Login(resource[, clientIP])
Parameters
The Login method accepts the following parameters:
resource (AgentResource object)
Specifies the resource to log in to.
clientIP (string)
(Optional) Specifies the client's IP address.
Return Value
The Login method returns one of the following values:
Specifies that user login was successful.
Specifies that user login failed.
Specifies that a challenge is required for authentication.
Specifies that the operation failed.
Specifies that the method timed out.
Specifies that the object was not connected.
Remarks
To allow one user, who is already logged in, to log in again as another user, call AgentUser‑>Impersonate.
The Logout method logs the user out of the session. Calling this method is optional, because the user is automatically logged out when the user object exceeds its scope in the Perl script.
Syntax
The Logout method has the following format:
Netegrity::AgentUser‑>Logout()
Parameters
The Logout method accepts no parameters.
Return Value
The Logout method returns one of the following values:
Specifies that the user logged out successfully.
Specifies that user logout failed.
Specifies that a challenge is required for authentication.
Specifies that the operation failed.
Specifies that the method timed out.
Specifies that the object was not connected.
Remarks
Calling Logout while one user is impersonating another user ends the impersonation session and restores the impersonator's original session. Calling AgentUser‑>Impersonate allows one user to impersonate or log in as another user.
The Name method sets or retrieves the user's username.
Syntax
The Name method has the following format:
Netegrity::AgentUser‑>Name([username])
Parameters
The Name method accepts the following parameter:
username (string)
(Optional) Specifies the username to set.
Return Value
The Name method returns the following value:
Specifies the new or existing username.
Remarks
Setting the username only affects the current instance of the user object. It does not affect the user's entry in the directory.
The Password method sets or retrieves the user's password.
Syntax
The Password method has the following format:
Netegrity::AgentUser‑>Password([password])
Parameters
The Password method accepts the following parameter:
password (string)
(Optional) Specifies the password to set.
Return Value
The Password method returns the following value:
Specifies the new or existing password.
Remarks
Setting the password only affects the current instance of the user object. It does not affect the user's entry in the directory.
The Validate method validates a session specification, checking that a user session has neither expired nor been terminated or revoked. This check can occur at any time during the life of a session.
Syntax
The Validate method has the following format:
Netegrity::AgentUser‑>Validate(resource[, clientIP][, transID])
Parameters
The Validate method accepts the following parameters:
resource (AgentResource object)
Specifies the resource to log in to.
clientIP (string)
(Optional) Specifies the client's IP address.
transID (string)
(Optional) Specifies a user-defined transaction ID.
Return Value
The Validate method returns one of the following values:
Specifies that the operation was successful.
Specifies that the user was not logged in.
Specifies that the operation failed.
Specifies that the method timed out.
Specifies that the object was not connected.
Remarks
The Policy Server validates a session specification or session ID, as follows:
Copyright © 2013 CA.
All rights reserved.
|
|