SiteMinder
Java SDK r12.0 SP2


netegrity.siteminder.javaagent
Class AgentAPI

java.lang.Object
  |
  +--netegrity.siteminder.javaagent.AgentAPI

public class AgentAPI
extends java.lang.Object

Provides Java access to the SiteMinder Agent API. For background information see SiteMinder Agents in the Java Developer's Guide.

This class is essentially a one-to-one cover over the C-language version of the SiteMinder Agent API. It relies on Java Native Interfaces (jdk 1.1.x or above), and requires the JavaAgentAPI library (dll or shared library) to be co-located with the JVM and accessible through PATH or LD_LIBRARY_PATH settings.

Since:
SiteMinder 4.0

Field Summary
static int ACCT_SERVER
          Accounting server port number.
static int AFFILIATE_KEY_UPDATE
          Constant denoting that the affiliate agent name was returned from doManagement().
static int AGENT_KEY_UPDATE_CURRENT
          Constant denoting that the "current" agent encryption key update was returned from doManagement().
static int AGENT_KEY_UPDATE_LAST
          Constant denoting that the "last" agent encryption key update was returned from doManagement().
static int AGENT_KEY_UPDATE_NEXT
          Constant denoting that the "next" agent encryption key update was returned from doManagement().
static int AGENT_KEY_UPDATE_PERSISTENT
          Constant denoting that the "persistent" agent encryption key update was returned from doManagement().
static int ATTR_AUTH_DIR_NAME
          Constant denoting the AUTH_DIR_NAME attribute id.
static int ATTR_AUTH_DIR_NAMESPACE
          Constant denoting the AUTH_DIR_NAMESPACE attribute id.
static int ATTR_AUTH_DIR_OID
          Constant denoting the AUTH_DIR_OID attribute id.
static int ATTR_AUTH_DIR_SERVER
          Constant denoting the AUTH_DIR_SERVER attribute id.
static int ATTR_CLIENTIP
          Constant denoting the client IP address
static int ATTR_DEVICENAME
          Constant denoting the device name
static int ATTR_IDENTITYSPEC
          Constant denoting the IDENTITYSPEC attribute id for the user's identity ticket.
static int ATTR_IDLESESSIONTIMEOUT
          Constant denoting the session's idle timeout
static int ATTR_LASTSESSIONTIME
          Constant denoting the last access time for the seesion
static int ATTR_MAXSESSIONTIMEOUT
          Constant denoting the max session time
static int ATTR_SERVICE_DATA
          Service response data returned as attributes from tunnel().
static int ATTR_SESSIONID
          Constant denoting the session identifier
static int ATTR_SESSIONSPEC
          Constant denoting the session specification
static int ATTR_STARTSESSIONTIME
          Constant denoting the session start time
static int ATTR_STATUS_MESSAGE
          Status message returned as an attribute from tunnel().
static int ATTR_USERDN
          Constant denoting the USERDN attribute id.
static int ATTR_USERMSG
          Constant denoting the USERMSG attribute id.
static int ATTR_USERNAME
          Constant denoting the user's name
static int ATTR_USERUNIVERSALID
          Constant denoting the USERUNIVERSALID attribute id.
static int AUTH_SERVER
          Authentication server port number.
static int AZ_SERVER
          Authorization server port number.
static int CACHE_FLUSH_ALL
          Constant denoting that the FLUSH_ALL attribute id was returned from doManagement().
static int CACHE_FLUSH_ALL_REALMS
          Constant denoting that the FLUSH_ALL_REALMS attribute id was returned from doManagement().
static int CACHE_FLUSH_ALL_USERS
          Constant denoting that the FLUSH_ALL_USERS attribute id was returned from doManagement().
static int CACHE_FLUSH_THIS_REALM
          Constant denoting that the FLUSH_THIS_REALM attribute id was returned from doManagement().
static int CACHE_FLUSH_THIS_USER
          Constant denoting that the FLUSH_THIS_USER attribute id was returned from doManagement().
static int CERT_HASH_SIZE
          Certificate hash size.
static int CHALLENGE
          Return status constant denoting a challenge is required for authentication.
static int CRED_ALLOWSAVECREDS
          Constant denoting that credentials can be saved.
static int CRED_BASIC
          Constant denoting that a username and password are required
static int CRED_CERT_OR_BASIC
          Constant denoting that either an X.509 certificate or a username and password are required.
static int CRED_CERT_OR_FORM
          Constant denoting cert or form authentication scheme
static int CRED_DIGEST
          Constant denoting that a credentials digest is required.
static int CRED_FORMREQUIRED
          Constant denoting that a redirect to an HTML form is required.
static int CRED_METADATA_REQUIRED
          Constant denoting save credentials hint
static int CRED_NONE
          Constant denoting that no credentials are required
static int CRED_NT_CHAL_RESP
          Constant denoting that the NT challenge response authentication scheme is required.
static int CRED_SAML
          Constant denoting SAML authentication scheme
static int CRED_SSLREQUIRED
          Constant denoting that SSL required.
static int CRED_X509CERT
          Constant denoting that an X509 certificate is required.
static int CRED_X509CERT_ISSUERDN
          Constant denoting that an X509 certificate and an issuer DN are required
static int CRED_X509CERT_USERDN
          Constant denoting that an X509 certificate and a user DN are required.
static int CRED_XML_DOCUMENT_MAPPED
          Constant denoting XML Document Mapped authentication scheme
static int CRED_XML_DSIG
          Constant denoting XML Digital Signature authentication scheme
static int CRED_XML_DSIG_XKMS
          Constant denoting XML Digital Signature XKMS authentication scheme
static int CRED_XML_WSSEC
          Constant denoting WS-Security authentication scheme
static int FAILURE
          Return status constant denoting that the server could not be reached.
static int INVALID_ATTRLIST
          Return status constant denoting that the attribute list is invalid.
static int INVALID_MGMTCTXDEF
          Return status constant denoting that the management context is invalid.
static int INVALID_REALMDEF
          Return status constant denoting that the realm definition is invalid.
static int INVALID_RESCTXDEF
          Return status constant denoting that the resource context definition is invalid.
static int INVALID_SESSIONDEF
          Return status constant denoting that the session definition is invalid.
static int INVALID_SESSIONID
          Return status constant denoting that the session id is invalid.
static int INVALID_TSR
          Return status constant denoting that the tunnel service request is invalid.
static int INVALID_USERCREDS
          Return status constant denoting that the user credentials are invalid.
static int NO
          Return status constant denoting that the operation failed.
static int NOCONNECTION
          Return status constant denoting that initialization was not done.
static int SM_AGENTAPI_REQATTR_FLAGS_DELETE
          Constant denoting the SM_AGENTAPI_REQATTR_FLAGS_DELETE request attribute.
static int SM_AGENTAPI_REQATTR_FLAGS_NONE
          Constant denoting the SM_AGENTAPI_REQATTR_FLAGS_NONE request attribute.
static int SM_AGENTAPI_RESPATTR_FLAGS_NONE
          Constant denoting the SM_AGENTAPI_RESPATTR_FLAGS_NONE response attribute.
static int SM_AGENTAPI_RESPATTR_FLAGS_UNRESOLVED
          Constant denoting the SM_AGENTAPI_RESPATTR_FLAGS_UNRESOLVED response attribute.
static int SUCCESS
          Return status constant denoting success.
static int TIMEOUT
          Return status constant denoting that the method timed out.
static int UNRESOLVED
          Return status constant denoting unresolved session variables.
static int YES
          Return status constant denoting that the operation succeeded.
 
Constructor Summary
AgentAPI()
          Constructs but does not initialize an Agent API object.
 
Method Summary
 int audit(java.lang.String clientIPAddr, java.lang.String transactionId, ResourceContextDef resCon, RealmDef realm, SessionDef session)
          Audits authorizations performed out of agent cache.
 int authorize(java.lang.String clientIpAddress, java.lang.String transactionId, ResourceContextDef rcd, RealmDef rd, SessionDef sd, AttributeList al)
          Determines if a defined user is authorized by SiteMinder to perform a defined action on a defined resource.
 int authorizeEx(java.lang.String clientIpAddress, java.lang.String transactionId, ResourceContextDef rcd, RealmDef rd, SessionDef sd, AttributeList al, java.lang.StringBuffer UnresolvedList, java.lang.StringBuffer ResolvedList, java.lang.Boolean bSimpleAuth)
          For internal use only.
 int createSSOToken(SessionDef sd, AttributeList al, java.lang.StringBuffer SSOToken)
          Creates and encrypts a single sign-on token.
 int decodeSSOToken(java.lang.String SSOToken, TokenDescriptor td, AttributeList al, boolean UpdateToken, java.lang.StringBuffer UpdatedSSOToken)
          Decodes a single sign-on token.
 int delSessionVariables(java.lang.String sessionId, ResourceContextDef rcd, AttributeList requestAttributeList, AttributeList responseAttributeList)
          Deletes the specified session variables from the session store.
 int delSessionVariablesEx(java.lang.String sessionId, ResourceContextDef rcd, AttributeList requestAttributeList, AttributeList responseAttributeList, java.lang.String transactionId)
          For internal use only.
 int doManagement(ManagementContextDef mc, AttributeList al)
          Checks for a pending management request (such as for cache flushing).
 int getAgentConfig(java.lang.String templateName, AttributeList attributeList)
          For internal use only.
 int getConfig(InitDef id, java.lang.String agentName, java.lang.String configPath)
          Gets configuration information for the specified agent.
 int getMaxTransactBufSize()
          This method is deprecated and will not be supported in the future.
 int getMaxTunnelBufSize()
          Gets the maximum tunnel buffer size that can be transferred in a call to tunnel().
 int getSessionVariables(java.lang.String sessionId, ResourceContextDef rcd, AttributeList requestAttributeList, AttributeList responseAttributeList)
          Retrieves the values of existing session variables.
 int getSessionVariablesEx(java.lang.String sessionId, ResourceContextDef rcd, AttributeList requestAttributeList, AttributeList responseAttributeList, java.lang.String transactionId)
          For internal use only.
 int init(InitDef id)
          Initializes the Agent API object.
 int isProtected(java.lang.String clientIpAddress, ResourceContextDef rcd, RealmDef rd)
          Checks whether a defined resource is protected by SiteMinder, and returns the relevant realm.
 int isProtectedEx(java.lang.String clientIpAddress, ResourceContextDef rcd, RealmDef rd, java.lang.String transactionId)
          For internal use only.
 int login(java.lang.String clientIpAddress, ResourceContextDef rcd, RealmDef rd, UserCredentials uc, SessionDef sd, AttributeList al)
          Performs session login or validates an existing session.
 int loginEx(java.lang.String clientIpAddress, ResourceContextDef rcd, RealmDef rd, UserCredentials uc, SessionDef sd, AttributeList al, java.lang.String transactionId)
          For internal use only.
 int logout(java.lang.String clientIPAddr, SessionDef sd)
          Logs a user out of a user session and issues an event.
 int logoutEx(java.lang.String clientIPAddr, SessionDef sd, java.lang.String transactionId)
          For internal use only.
 int makeCertificateHash(BinaryBuffer cert, BinaryBuffer hash)
          Perform a hash of a public key certificate
 int setSessionVariables(java.lang.String sessionId, ResourceContextDef rcd, AttributeList requestAttributeList, AttributeList responseAttributeList)
          Creates new session variables or updates existing session variables.
 int setSessionVariablesEx(java.lang.String sessionId, ResourceContextDef rcd, AttributeList requestAttributeList, AttributeList responseAttributeList, java.lang.String transactionId)
          For internal use only.
 int transact(int serverNumber, BinaryBuffer bb)
          This method is deprecated and will not be supported in the future.
 int tunnel(short server, java.lang.String clientIpAddr, java.lang.String transactionId, ResourceContextDef resourceContext, TunnelServiceRequest tsr, AttributeList responseAttribs)
          Communicates with back-end services that have been registered with the Policy Server.
 int unInit()
          Uninitializes the Agent API object.
 int updateAttributes(java.lang.String clientIPAddr, java.lang.String transactionId, ResourceContextDef resourceContext, RealmDef realm, SessionDef session, AttributeList requestAttribs, AttributeList responseAttribs)
          Update response attributes when authenticating or authorizing out of agent cache.
 int validate(java.lang.String clientIpAddress, ResourceContextDef rcd, RealmDef rd, UserCredentials uc, SessionDef sd, AttributeList al)
          For internal use only.
 int validateEx(java.lang.String clientIpAddress, ResourceContextDef rcd, RealmDef rd, UserCredentials uc, SessionDef sd, AttributeList al, java.lang.String transactionId)
          For internal use only.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_SESSIONID

public static final int INVALID_SESSIONID
Return status constant denoting that the session id is invalid.

See Also:
Constant Field Values

INVALID_MGMTCTXDEF

public static final int INVALID_MGMTCTXDEF
Return status constant denoting that the management context is invalid.

See Also:
Constant Field Values

INVALID_ATTRLIST

public static final int INVALID_ATTRLIST
Return status constant denoting that the attribute list is invalid.

See Also:
Constant Field Values

INVALID_TSR

public static final int INVALID_TSR
Return status constant denoting that the tunnel service request is invalid.

See Also:
Constant Field Values

INVALID_SESSIONDEF

public static final int INVALID_SESSIONDEF
Return status constant denoting that the session definition is invalid.

See Also:
Constant Field Values

INVALID_USERCREDS

public static final int INVALID_USERCREDS
Return status constant denoting that the user credentials are invalid.

See Also:
Constant Field Values

INVALID_REALMDEF

public static final int INVALID_REALMDEF
Return status constant denoting that the realm definition is invalid.

See Also:
Constant Field Values

INVALID_RESCTXDEF

public static final int INVALID_RESCTXDEF
Return status constant denoting that the resource context definition is invalid.

See Also:
Constant Field Values

NOCONNECTION

public static final int NOCONNECTION
Return status constant denoting that initialization was not done.

See Also:
Constant Field Values

TIMEOUT

public static final int TIMEOUT
Return status constant denoting that the method timed out.

See Also:
Constant Field Values

FAILURE

public static final int FAILURE
Return status constant denoting that the server could not be reached.

See Also:
Constant Field Values

SUCCESS

public static final int SUCCESS
Return status constant denoting success.

See Also:
Constant Field Values

YES

public static final int YES
Return status constant denoting that the operation succeeded.

See Also:
Constant Field Values

NO

public static final int NO
Return status constant denoting that the operation failed.

See Also:
Constant Field Values

CHALLENGE

public static final int CHALLENGE
Return status constant denoting a challenge is required for authentication.

See Also:
Constant Field Values

UNRESOLVED

public static final int UNRESOLVED
Return status constant denoting unresolved session variables. Examples of unresolved session variables include variables that the delSessionVariables() method couldn't delete or that the getSessionVariables() method couldn't retreive.

Since:
SDK 5.5
See Also:
Constant Field Values

CRED_NONE

public static final int CRED_NONE
Constant denoting that no credentials are required

See Also:
Constant Field Values

CRED_BASIC

public static final int CRED_BASIC
Constant denoting that a username and password are required

See Also:
Constant Field Values

CRED_DIGEST

public static final int CRED_DIGEST
Constant denoting that a credentials digest is required. With a digest, users are identified by comparing an encrypted user attribute string stored in a server's directory against an encrypted string entered by the user. If these strings match, the user's identity is verified. The supported digest authentication schemes are RADIUS CHAP and RADIUS PAP.

See Also:
Constant Field Values

CRED_X509CERT

public static final int CRED_X509CERT
Constant denoting that an X509 certificate is required.

See Also:
Constant Field Values

CRED_X509CERT_USERDN

public static final int CRED_X509CERT_USERDN
Constant denoting that an X509 certificate and a user DN are required.

See Also:
Constant Field Values

CRED_X509CERT_ISSUERDN

public static final int CRED_X509CERT_ISSUERDN
Constant denoting that an X509 certificate and an issuer DN are required

See Also:
Constant Field Values

CRED_CERT_OR_BASIC

public static final int CRED_CERT_OR_BASIC
Constant denoting that either an X.509 certificate or a username and password are required.

See Also:
Constant Field Values

CRED_NT_CHAL_RESP

public static final int CRED_NT_CHAL_RESP
Constant denoting that the NT challenge response authentication scheme is required.

See Also:
Constant Field Values

CRED_CERT_OR_FORM

public static final int CRED_CERT_OR_FORM
Constant denoting cert or form authentication scheme

See Also:
Constant Field Values

CRED_XML_DOCUMENT_MAPPED

public static final int CRED_XML_DOCUMENT_MAPPED
Constant denoting XML Document Mapped authentication scheme

See Also:
Constant Field Values

CRED_XML_DSIG

public static final int CRED_XML_DSIG
Constant denoting XML Digital Signature authentication scheme

See Also:
Constant Field Values

CRED_XML_DSIG_XKMS

public static final int CRED_XML_DSIG_XKMS
Constant denoting XML Digital Signature XKMS authentication scheme

See Also:
Constant Field Values

CRED_SAML

public static final int CRED_SAML
Constant denoting SAML authentication scheme

See Also:
Constant Field Values

CRED_XML_WSSEC

public static final int CRED_XML_WSSEC
Constant denoting WS-Security authentication scheme

See Also:
Constant Field Values

CRED_SSLREQUIRED

public static final int CRED_SSLREQUIRED
Constant denoting that SSL required. This requirement can be used with CRED_BASIC.

See Also:
Constant Field Values

CRED_FORMREQUIRED

public static final int CRED_FORMREQUIRED
Constant denoting that a redirect to an HTML form is required.

See Also:
Constant Field Values

CRED_ALLOWSAVECREDS

public static final int CRED_ALLOWSAVECREDS
Constant denoting that credentials can be saved.

See Also:
Constant Field Values

CRED_METADATA_REQUIRED

public static final int CRED_METADATA_REQUIRED
Constant denoting save credentials hint

See Also:
Constant Field Values

ATTR_AUTH_DIR_NAME

public static final int ATTR_AUTH_DIR_NAME
Constant denoting the AUTH_DIR_NAME attribute id. This is the "name" specification of the directory where the user has been authenticated.

See Also:
Constant Field Values

ATTR_AUTH_DIR_SERVER

public static final int ATTR_AUTH_DIR_SERVER
Constant denoting the AUTH_DIR_SERVER attribute id. This is the "server" specification of the directory where the user has been authenticated.

See Also:
Constant Field Values

ATTR_AUTH_DIR_NAMESPACE

public static final int ATTR_AUTH_DIR_NAMESPACE
Constant denoting the AUTH_DIR_NAMESPACE attribute id. This is the "namespace" specification of the directory where the user has been authenticated.

See Also:
Constant Field Values

ATTR_USERMSG

public static final int ATTR_USERMSG
Constant denoting the USERMSG attribute id. This is text presented to the user as a result of authentication. Some authentication schemes supply challenge text or a reason why an authentication has failed.

See Also:
Constant Field Values

ATTR_USERDN

public static final int ATTR_USERDN
Constant denoting the USERDN attribute id. The user’s distinguished name as recognized by SiteMinder.

See Also:
Constant Field Values

ATTR_AUTH_DIR_OID

public static final int ATTR_AUTH_DIR_OID
Constant denoting the AUTH_DIR_OID attribute id. This is the object id of the directory where the user has been authenticated.

See Also:
Constant Field Values

ATTR_USERUNIVERSALID

public static final int ATTR_USERUNIVERSALID
Constant denoting the USERUNIVERSALID attribute id. This is the user's universal ID.

See Also:
Constant Field Values

ATTR_IDENTITYSPEC

public static final int ATTR_IDENTITYSPEC
Constant denoting the IDENTITYSPEC attribute id for the user's identity ticket. This attribute is returned if the Web server's user-tracking feature is enabled.

See Also:
Constant Field Values

ATTR_STARTSESSIONTIME

public static final int ATTR_STARTSESSIONTIME
Constant denoting the session start time

See Also:
Constant Field Values

ATTR_LASTSESSIONTIME

public static final int ATTR_LASTSESSIONTIME
Constant denoting the last access time for the seesion

See Also:
Constant Field Values

ATTR_DEVICENAME

public static final int ATTR_DEVICENAME
Constant denoting the device name

See Also:
Constant Field Values

ATTR_SESSIONID

public static final int ATTR_SESSIONID
Constant denoting the session identifier

See Also:
Constant Field Values

ATTR_CLIENTIP

public static final int ATTR_CLIENTIP
Constant denoting the client IP address

See Also:
Constant Field Values

ATTR_SESSIONSPEC

public static final int ATTR_SESSIONSPEC
Constant denoting the session specification

See Also:
Constant Field Values

ATTR_USERNAME

public static final int ATTR_USERNAME
Constant denoting the user's name

See Also:
Constant Field Values

ATTR_IDLESESSIONTIMEOUT

public static final int ATTR_IDLESESSIONTIMEOUT
Constant denoting the session's idle timeout

See Also:
Constant Field Values

ATTR_MAXSESSIONTIMEOUT

public static final int ATTR_MAXSESSIONTIMEOUT
Constant denoting the max session time

See Also:
Constant Field Values

AFFILIATE_KEY_UPDATE

public static final int AFFILIATE_KEY_UPDATE
Constant denoting that the affiliate agent name was returned from doManagement().

See Also:
Constant Field Values

AGENT_KEY_UPDATE_NEXT

public static final int AGENT_KEY_UPDATE_NEXT
Constant denoting that the "next" agent encryption key update was returned from doManagement(). Attribute data format is binary, 24 bytes.

See Also:
Constant Field Values

AGENT_KEY_UPDATE_LAST

public static final int AGENT_KEY_UPDATE_LAST
Constant denoting that the "last" agent encryption key update was returned from doManagement(). Attribute data format is binary, 24 bytes.

See Also:
Constant Field Values

AGENT_KEY_UPDATE_CURRENT

public static final int AGENT_KEY_UPDATE_CURRENT
Constant denoting that the "current" agent encryption key update was returned from doManagement(). Attribute data format is binary, 24 bytes.

See Also:
Constant Field Values

AGENT_KEY_UPDATE_PERSISTENT

public static final int AGENT_KEY_UPDATE_PERSISTENT
Constant denoting that the "persistent" agent encryption key update was returned from doManagement(). Attribute data format is binary, 24 bytes.

See Also:
Constant Field Values

CACHE_FLUSH_ALL

public static final int CACHE_FLUSH_ALL
Constant denoting that the FLUSH_ALL attribute id was returned from doManagement().

See Also:
Constant Field Values

CACHE_FLUSH_ALL_USERS

public static final int CACHE_FLUSH_ALL_USERS
Constant denoting that the FLUSH_ALL_USERS attribute id was returned from doManagement().

See Also:
Constant Field Values

CACHE_FLUSH_THIS_USER

public static final int CACHE_FLUSH_THIS_USER
Constant denoting that the FLUSH_THIS_USER attribute id was returned from doManagement(). Attribute data format is Dir OID + "/" + User DN.

See Also:
Constant Field Values

CACHE_FLUSH_ALL_REALMS

public static final int CACHE_FLUSH_ALL_REALMS
Constant denoting that the FLUSH_ALL_REALMS attribute id was returned from doManagement().

See Also:
Constant Field Values

CACHE_FLUSH_THIS_REALM

public static final int CACHE_FLUSH_THIS_REALM
Constant denoting that the FLUSH_THIS_REALM attribute id was returned from doManagement(). Attribute data format is a realm OID.

See Also:
Constant Field Values

ATTR_STATUS_MESSAGE

public static final int ATTR_STATUS_MESSAGE
Status message returned as an attribute from tunnel().

See Also:
Constant Field Values

ATTR_SERVICE_DATA

public static final int ATTR_SERVICE_DATA
Service response data returned as attributes from tunnel().

See Also:
Constant Field Values

CERT_HASH_SIZE

public static final int CERT_HASH_SIZE
Certificate hash size.

See Also:
Constant Field Values

AZ_SERVER

public static final int AZ_SERVER

Authorization server port number. Because of the Policy Server single-process functionality introduced in SiteMinder v6.0, this port number is the same as the AUTH_SERVER and ACCT_SERVER port number.

The single-process Policy Server combines the previously separate Authentication, Authorization, and Accounting processes into one combined process whose requests go through one TCP port.

See Also:
Constant Field Values

AUTH_SERVER

public static final int AUTH_SERVER

Authentication server port number. Because of the Policy Server single-process functionality introduced in SiteMinder v6.0, this port number is the same as the AZ_SERVER and ACCT_SERVER port number.

The single-process Policy Server combines the previously separate Authentication, Authorization, and Accounting processes into one combined process whose requests go through one TCP port.

See Also:
Constant Field Values

ACCT_SERVER

public static final int ACCT_SERVER

Accounting server port number. Because of the Policy Server single-process functionality introduced in SiteMinder v6.0, this port number is the same as the AUTH_SERVER and AZ_SERVER port number.

The single-process Policy Server combines the previously separate Authentication, Authorization, and Accounting processes into one combined process whose requests go through one TCP port.

See Also:
Constant Field Values

SM_AGENTAPI_REQATTR_FLAGS_NONE

public static final int SM_AGENTAPI_REQATTR_FLAGS_NONE
Constant denoting the SM_AGENTAPI_REQATTR_FLAGS_NONE request attribute. This constant requests default handling of the specified session variable when you are getting, setting, or deleting the variable.

Assign this flag to the flags field of the Attribute object.

Since:
SDK 5.5
See Also:
Constant Field Values

SM_AGENTAPI_REQATTR_FLAGS_DELETE

public static final int SM_AGENTAPI_REQATTR_FLAGS_DELETE
Constant denoting the SM_AGENTAPI_REQATTR_FLAGS_DELETE request attribute. This constant requests that the session variable be deleted after it is retieved in a call to getSessionVariables().

Assign this flag to the flags field of the Attribute object.

Since:
SDK 5.5
See Also:
Constant Field Values

SM_AGENTAPI_RESPATTR_FLAGS_NONE

public static final int SM_AGENTAPI_RESPATTR_FLAGS_NONE
Constant denoting the SM_AGENTAPI_RESPATTR_FLAGS_NONE response attribute. This constant denotes the default flag for the associated session variable.

This flag is returned in the flags field of the Attribute object.

Since:
SDK 5.5
See Also:
Constant Field Values

SM_AGENTAPI_RESPATTR_FLAGS_UNRESOLVED

public static final int SM_AGENTAPI_RESPATTR_FLAGS_UNRESOLVED
Constant denoting the SM_AGENTAPI_RESPATTR_FLAGS_UNRESOLVED response attribute. This constant denotes that the associated session variable was unresolved, could not be set, or could not be deleted.

This flag is returned in the flags field of the Attribute object.

Since:
SDK 5.5
See Also:
Constant Field Values
Constructor Detail

AgentAPI

public AgentAPI()
Constructs but does not initialize an Agent API object. Initialize the object by calling init().

Method Detail

init

public int init(InitDef id)
Initializes the Agent API object.

This method is designed to fail only when a connection to the Policy Server is established, but the shared secret and/or agent name are incorrect. In all other circumstances, this method returns SUCCESS, such as in the following circumstances:


In the above cases, the Agent API returns a status of success and continues to try to establish the connection to the Policy Server.

You should not assume that a connection to the Policy Server is established if the Init() function succeeds.

Parameters:
id - The object containing the initialization values.
Returns:
SUCCESS if the operation succeeded. FAILURE otherwise.

unInit

public int unInit()
Uninitializes the Agent API object.

Returns:
One of these values:
  • SUCCESS. The operation succeeded.
  • NOCONNECTION. The object was not connected.
  • FAILURE. The operation failed.

isProtected

public int isProtected(java.lang.String clientIpAddress,
                       ResourceContextDef rcd,
                       RealmDef rd)
Checks whether a defined resource is protected by SiteMinder, and returns the relevant realm.

Parameters:
clientIpAddress - The IP address of the client asking for the resource.
rcd - The resource to be checked.
rd - With return values of YES or NO, contains the realm information needed to authenticate.
Returns:
One of these values:
  • YES. The resource is protected.
  • NO. The resource is not protected.
  • NOCONNECTION. The object was not connected.
  • INVALID_RESCTXDEF. The Resource Context Definition is invalid.
  • INVALID_REALMDEF. The Realm Definition is invalid.
  • TIMEOUT. The server did not respond in the specified time.
  • FAILURE. The operation failed.

isProtectedEx

public int isProtectedEx(java.lang.String clientIpAddress,
                         ResourceContextDef rcd,
                         RealmDef rd,
                         java.lang.String transactionId)
For internal use only.


login

public int login(java.lang.String clientIpAddress,
                 ResourceContextDef rcd,
                 RealmDef rd,
                 UserCredentials uc,
                 SessionDef sd,
                 AttributeList al)

Performs session login or validates an existing session.

Use this method for login of all users and administrators except for SiteMinder administrators. For login of SiteMinder administrators, use login() in class SmApiSession of the Utilities package.

Parameters:
clientIpAddress - The IP address of the client requesting the resource.
rcd - The resource to be checked.
rd - The realm that the resource belongs to.
uc - The credentials of the user to be authenticated. Note: Unused fields in the UserCredentials object must be initialized to zero.
sd - With a return status of YES, NO, or CHALLENGE, this parameter contains the session data.
al - On return from the method, this parameter contains any response attributes, or is cleared if there are none. Valid values: ATTR_AUTH_DIR_OID
ATTR_AUTH_DIR_NAME
ATTR_AUTH_DIR_SERVER
ATTR_AUTH_DIR_NAMESPACE
ATTR_USERMSG
ATTR_USERDN
ATTR_USERUNIVERSALID
Returns:
One of these values:
  • YES. The authentication was successful.
  • NO. The authentication was not not successful.
  • CHALLENGE. A user challenge is required.
  • NOCONNECTION. The object was not connected.
  • TIMEOUT. The server did not respond in the specified time.
  • FAILURE. The operation failed.
  • INVALID_RESCTXDEF. The Resource Context Definition is invalid.
  • INVALID_REALMDEF. The Realm Definition is invalid.
  • INVALID_USERCREDS. The User Credentials are invalid.
  • INVALID_SESSIONDEF. The Session Definition is invalid.
  • INVALID_ATTRLIST. The Attribute List is invalid.

loginEx

public int loginEx(java.lang.String clientIpAddress,
                   ResourceContextDef rcd,
                   RealmDef rd,
                   UserCredentials uc,
                   SessionDef sd,
                   AttributeList al,
                   java.lang.String transactionId)
For internal use only.


validate

public int validate(java.lang.String clientIpAddress,
                    ResourceContextDef rcd,
                    RealmDef rd,
                    UserCredentials uc,
                    SessionDef sd,
                    AttributeList al)
For internal use only.


validateEx

public int validateEx(java.lang.String clientIpAddress,
                      ResourceContextDef rcd,
                      RealmDef rd,
                      UserCredentials uc,
                      SessionDef sd,
                      AttributeList al,
                      java.lang.String transactionId)
For internal use only.


authorize

public int authorize(java.lang.String clientIpAddress,
                     java.lang.String transactionId,
                     ResourceContextDef rcd,
                     RealmDef rd,
                     SessionDef sd,
                     AttributeList al)
Determines if a defined user is authorized by SiteMinder to perform a defined action on a defined resource.

Parameters:
clientIpAddress - The client's IP address in dotted-quad notation.
transactionId - (Optional.) The ID that the agent uses to associate application activity with security activity. The Policy Server logs this ID.
rcd - The resource to be checked.
rd - The realm that the resource belongs to.
sd - Session information for the authenticated user.
al - On return from the method, contains any response attributes about the user with respect to the resource, or is cleared if there are none.
Returns:
One of these values:
  • YES. The user is authorized to access the resource.
  • NO. The user is not authorized to access the resource.
  • NOCONNECTION. The object was not connected.
  • TIMEOUT. The server did not respond in the specified time.
  • FAILURE. The operation failed.
  • INVALID_RESCTXDEF. The Resource Context Definition is invalid.
  • INVALID_REALMDEF. The Realm Definition is invalid.
  • INVALID_SESSIONDEF. The Session Definition is invalid.
  • INVALID_ATTRLIST. The Attribute List is invalid.

authorizeEx

public int authorizeEx(java.lang.String clientIpAddress,
                       java.lang.String transactionId,
                       ResourceContextDef rcd,
                       RealmDef rd,
                       SessionDef sd,
                       AttributeList al,
                       java.lang.StringBuffer UnresolvedList,
                       java.lang.StringBuffer ResolvedList,
                       java.lang.Boolean bSimpleAuth)
For internal use only.


doManagement

public int doManagement(ManagementContextDef mc,
                        AttributeList al)
Checks for a pending management request (such as for cache flushing).

Parameters:
mc - A ManagementContextDef object that describes the requested management action.
al - On return from the method, this parameter contains any response attributes, or is cleared if there are none. Valid values: AGENT_KEY_UPDATE_NEXT
AGENT_KEY_UPDATE_LAST
AGENT_KEY_UPDATE_CURRENT
AGENT_KEY_UPDATE_PERSISTENT
CACHE_FLUSH_ALL
CACHE_FLUSH_ALL_USERS
CACHE_FLUSH_THIS_USER
CACHE_FLUSH_ALL_REALMS
CACHE_FLUSH_THIS_REALM
Returns:
  • YES. There is a management request.
  • NOCONNECTION. The object was not connected.
  • TIMEOUT. The server did not respond in the specified time.
  • FAILURE. The operation failed.
  • INVALID_MGMTCTXDEF. The Management Context Definition is invalid.
  • INVALID_ATTRLIST. The Attribute List is invalid.

transact

public int transact(int serverNumber,
                    BinaryBuffer bb)
This method is deprecated and will not be supported in the future.


makeCertificateHash

public int makeCertificateHash(BinaryBuffer cert,
                               BinaryBuffer hash)
Perform a hash of a public key certificate

Parameters:
cert - The target certificate.
hash - On return from the method, this parameter contains the hash value.
Returns:
  • SUCCESS. The operation succeeded.
  • FAILURE. The operation failed.

logout

public int logout(java.lang.String clientIPAddr,
                  SessionDef sd)

Logs a user out of a user session and issues an event. No database is updated.

To terminate the session, you must discard the session specification after logging out the user. To do so, set the SessionDef object to null -- for example:
 result = aa.logout(clientIPAddr, sd);
 if (result == YES)
      sd = null;
Use this method for logout of all users and administrators except for SiteMinder administrators. For logout of SiteMinder administrators, use logout() in class SmApiSession of the Utilities package.

Parameters:
clientIPAddr - (Optional) The client IP address.
sd - The current session.
Returns:
One of these values:
  • YES. The user logged out successfully.
  • NO. The user was not logged out.
  • NOCONNECTION. The object was not connected.
  • TIMEOUT. The method timed out.
  • FAILURE. The operation failed.
  • INVALID_SESSIONDEF. The Session Definition is invalid.

logoutEx

public int logoutEx(java.lang.String clientIPAddr,
                    SessionDef sd,
                    java.lang.String transactionId)
For internal use only.


audit

public int audit(java.lang.String clientIPAddr,
                 java.lang.String transactionId,
                 ResourceContextDef resCon,
                 RealmDef realm,
                 SessionDef session)
Audits authorizations performed out of agent cache. The updated session specification is returned in session.

Parameters:
clientIPAddr - (Optional) The client IP address.
transactionId - (Optional) The client-side transaction Id.
resCon - resource The resource context definition.
realm - The realm definition.
session - The session definition.
Returns:
One of these values:
  • YES. The audit was successful.
  • NO. The audit was not successful.
  • NOCONNECTION. The object was not connected.
  • TIMEOUT. The method timed out.
  • FAILURE. The operation failed.
  • INVALID_RESCTXDEF. The Resource Context Definition is invalid.
  • INVALID_REALMDEF. The Realm Definition is invalid.
  • INVALID_SESSIONDEF. The Session Definition is invalid.

updateAttributes

public int updateAttributes(java.lang.String clientIPAddr,
                            java.lang.String transactionId,
                            ResourceContextDef resourceContext,
                            RealmDef realm,
                            SessionDef session,
                            AttributeList requestAttribs,
                            AttributeList responseAttribs)
Update response attributes when authenticating or authorizing out of agent cache.

Parameters:
clientIPAddr - The client IP address.
transactionId - The client-side transaction Id.
resourceContext - The resource context definition.
realm - The realm definition.
session - The session definition object.
requestAttribs - The request attributes.
responseAttribs - The response attributes.
Returns:
One of these values:
  • YES. The update was successful.
  • NO. The update failed.
  • NOCONNECTION. The object was not connected.
  • TIMEOUT. The method timed out.
  • FAILURE. The operation failed.
  • INVALID_RESCTXDEF. The Resource Context Definition is invalid.
  • INVALID_REALMDEF. The Realm Definition is invalid.
  • INVALID_SESSIONDEF. The Session Definition is invalid.
  • INVALID_ATTRLIST. The Attribute List is invalid.

getMaxTunnelBufSize

public int getMaxTunnelBufSize()
Gets the maximum tunnel buffer size that can be transferred in a call to tunnel().

Returns:
The maximum tunnel buffer size.

tunnel

public int tunnel(short server,
                  java.lang.String clientIpAddr,
                  java.lang.String transactionId,
                  ResourceContextDef resourceContext,
                  TunnelServiceRequest tsr,
                  AttributeList responseAttribs)

Communicates with back-end services that have been registered with the Policy Server.

Call this method to transfer data between a remote service on the Policy server side and your agent. Also, call getMaxTunnelBufSize() to find out the maximum data size that can be transferred.

Before calling tunnel(), create an instance of the ResourceContextDef class. When you create this instance, pass four null strings in to the constructor -- for example:
     ResourceContextDef rcd = new ResourceContextDef("","","","");

Parameters:
server - The server that will process the request at the time of the tunnel call. Valid values:
  • AZ_SERVER. The authorization server port number.
  • AUTH_SERVER. The authentication server port number.
  • ACCT_SERVER. The accounting server port number.
clientIpAddr - The client IP address.
transactionId - The client-side transaction Id.
resourceContext - The resource context definition.
tsr - The definition of the tunnel service request.
responseAttribs - One of these response attributes:
  • SM_AGENTAPI_ATTR_SERVICE_DATA. The data returned by the remote service.
  • SM_AGENTAPI_ATTR_STATUS_MESSAGE. The status message from the remote service.
Returns:
  • YES. The transfer succeeded and a response is available.
  • NO. The server doesn't support this operation.
  • NOCONNECTION. The object was not connected.
  • TIMEOUT
  • . The method timed out.
  • INVALID_TSRTunnel Service Request is invalid
  • INVALID_ATTRLIST. The attribute list is invalid.
  • FAILURE
  • . The operation failed.

getMaxTransactBufSize

public int getMaxTransactBufSize()
This method is deprecated and will not be supported in the future.


getConfig

public int getConfig(InitDef id,
                     java.lang.String agentName,
                     java.lang.String configPath)
Gets configuration information for the specified agent. This method can read configuration information either from a configuration file or, on a Microsoft Windows platform, from the Windows Registry.

If your custom agent uses a configuration file, be sure to set configPath to the configuration file. getConfig() checks the value of configPath to find the path to a configuration file. If configPath is empty and the agent is written for a Microsoft Windows platform, getConfig()) searches the Windows Registry for the configuration information. If configPath is empty and the agent is running on a UNIX system, getConfig() returns FAILURE.

In the configuration file or Registry, getConfig() searches the agentname list for the agent named in the parameter agentName. If agentName is empty, getConfig() retrieves the default agent name. If getConfig() cannot retrieve the default agent name, it returns FAILURE.

Once getConfig() locates the configuration information for the correct agent, it copies the information into the InitDef object (parameter id).

For example, suppose the agentName parameter contains the string Agent1 and the agentname list of the configuration file is set as follows:

agentname="Agent1,123.112.12.12"

In this circumstance, getConfig() sets the hostName parameter of the InitDef constructor to Agent1. The IP Address is ignored. getConfig() then retrieves the other information for the InitDef object.

Parameters:
id - On return from the method, this parameter contains the configuration information.
agentName - The name of the agent to retrieve configuration information from. If no agent name is specified, getConfig() retrieves configuration information for the default agent.
configPath - The path to the agent configuration file webagent.conf -- for example, c:\netscape\server4\https-1\config\webagent.conf. Any path specified along with the filename is opened for parsing. Set this parameter as an empty string (""), only for the 4QMRx web agent on IIS.
Returns:
SUCCESS if configuration information was successfully retrieved. Otherwise FAILURE.
Since:
SiteMinder 4.51 SP1 and SiteMinder 4.61

getAgentConfig

public int getAgentConfig(java.lang.String templateName,
                          AttributeList attributeList)
For internal use only.


getSessionVariables

public int getSessionVariables(java.lang.String sessionId,
                               ResourceContextDef rcd,
                               AttributeList requestAttributeList,
                               AttributeList responseAttributeList)
Retrieves the values of existing session variables. Optionally, you can delete the values after retireving them.

The session must be active for session variables to be retrieved.

Parameters:
sessionId - A unique identifier of the session for which the variable is to be retrieved. After a successful login, the session id is returned in SessionDef.
rcd - Reserved for future use.
requestAttributeList - An array of attributes representing the names of session variables to be retrieved. Set the flags field of each Attribute object to one of these values:
responseAttributeList - On successful return from this method (YES is returned), this output parameter contains the retrieved variable names and their values. If the method returns UNRESOLVED, this parameter includes variables that could not be retrieved. Further:
Returns:
  • YES. The session variables were successfully retrieved.
  • NO. The session variables were not retrieved.
  • UNRESOLVED. Some variables could not be retrieved.
  • CHALLENGE. A user challenge is required.
  • NOCONNECTION. The object was not connected.
  • TIMEOUT. The server did not respond in the specified time.
  • FAILURE. The operation failed.
  • INVALID_SESSIONID. The session id is invalid.
  • INVALID_ATTRLIST. The attribute list is invalid.
Since:
SDK 5.5

getSessionVariablesEx

public int getSessionVariablesEx(java.lang.String sessionId,
                                 ResourceContextDef rcd,
                                 AttributeList requestAttributeList,
                                 AttributeList responseAttributeList,
                                 java.lang.String transactionId)
For internal use only.


setSessionVariables

public int setSessionVariables(java.lang.String sessionId,
                               ResourceContextDef rcd,
                               AttributeList requestAttributeList,
                               AttributeList responseAttributeList)
Creates new session variables or updates existing session variables.

If a specified variable name already exists, its value will be overwritten by the new variable value. If a specified variable name doesn't exist, a new variable is created.

The session must be active for session variables to be set.

Parameters:
sessionId - A unique identifier of the session for which the variable is to be set. After a successful login, the session id is returned in SessionDef.
rcd - Reserved for future use.
requestAttributeList - An array of attributes representing the names and values of session variables to be set. Set the flags field of the Attribute object to SM_AGENTAPI_REQATTR_FLAGS_NONE.
responseAttributeList - If the method returns UNRESOLVED, this output parameter contains variables that could not be set. The flags field of the Attribute object is set to SM_AGENTAPI_RESPATTR_FLAGS_UNRESOLVED for each variable that could not be set.
Returns:
  • YES. The session variables were successfully set.
  • NO. The session variables were not set.
  • UNRESOLVED. Some variables could not be set.
  • CHALLENGE. A user challenge is required.
  • NOCONNECTION. The object was not connected.
  • TIMEOUT. The server did not respond in the specified time.
  • FAILURE. The operation failed.
  • INVALID_SESSIONID. The session id is invalid.
  • INVALID_ATTRLIST. The attribute list is invalid.
Since:
SDK 5.5

setSessionVariablesEx

public int setSessionVariablesEx(java.lang.String sessionId,
                                 ResourceContextDef rcd,
                                 AttributeList requestAttributeList,
                                 AttributeList responseAttributeList,
                                 java.lang.String transactionId)
For internal use only.


delSessionVariables

public int delSessionVariables(java.lang.String sessionId,
                               ResourceContextDef rcd,
                               AttributeList requestAttributeList,
                               AttributeList responseAttributeList)
Deletes the specified session variables from the session store.

The session must be active for session variables to be deleted.

Parameters:
sessionId - A unique identifier of the session for which the variable is to be deleted. After a successful login, the session id is returned in SessionDef.
rcd - Reserved for future use.
requestAttributeList - An array of attributes representing the names of session variables to be deleted. Set the flags field of the Attribute object to SM_AGENTAPI_REQATTR_FLAGS_NONE.
responseAttributeList - If this method returns UNRESOLVED, this output parameter contains variables that could not be deleted. The flags field of the Attribute object is set to SM_AGENTAPI_RESPATTR_FLAGS_UNRESOLVED for each variable that could not be deleted.
Returns:
  • YES. The session variables were successfully deleted.
  • NO. The session variables were not deleted.
  • UNRESOLVED. Some variables could not be deleted.
  • CHALLENGE. A user challenge is required.
  • NOCONNECTION. The object was not connected.
  • TIMEOUT. The server did not respond in the specified time.
  • FAILURE. The operation failed.
  • INVALID_SESSIONID. The session id is invalid.
  • INVALID_ATTRLIST. The attribute list is invalid.
Since:
SDK 5.5

delSessionVariablesEx

public int delSessionVariablesEx(java.lang.String sessionId,
                                 ResourceContextDef rcd,
                                 AttributeList requestAttributeList,
                                 AttributeList responseAttributeList,
                                 java.lang.String transactionId)
For internal use only.


createSSOToken

public int createSSOToken(SessionDef sd,
                          AttributeList al,
                          java.lang.StringBuffer SSOToken)

Creates and encrypts a single sign-on token.

This method associates the user attribute information specified in the al parameter with session and other attribute information returned from the login call. The information in the resulting token can be shared between standard SiteMinder Web Agents and custom agents, allowing single sign-on operations between the standard and custom agents.

Single sign-on between standard and custom agents requires that the agents be in the same domain.

Lists containing the Attribute class are used by this method. The only fields in this class that are used with this method are id and value.

This method does not allocate any memory.

To decode token information, call decodeSSOToken().

Parameters:
sd - The session information for the authenticated user.
al - The attributes to include in the token. Valid values:
  • ATTR_USERDN. The user's distinguished name.
  • ATTR_USERNAME. The user's name.
  • ATTR_CLIENTIP. The IP address of the machine where the user initiated a request for a protected resource.
Any other attribute is ignored.
SSOToken - On return, this parameter contains the single sign-on token. Write this token to the SMSESSION cookie.
Returns:
  • SUCCESS. The operation succeeded.
  • FAILURE. The token was not created.
  • NOCONNECTION. There was no connection to the Policy Server.
  • INVALID_SESSIONDEF. The Session Definition is invalid.
  • INVALID_ATTRLIST. The attribute list is invalid.
Since:
SDK 2.2

decodeSSOToken

public int decodeSSOToken(java.lang.String SSOToken,
                          TokenDescriptor td,
                          AttributeList al,
                          boolean UpdateToken,
                          java.lang.StringBuffer UpdatedSSOToken)

Decodes a single sign-on token. This method accepts a single sign-on token as input and returns a subset of the token's attributes.

Optionally, you can update the token's last-access timestamp, and then update the SMSESSION cookie with the new token.

To update the token's last-access timestamp, assign true to parameter UpdateToken. The token that includes the updated timestamp is returned in UpdatedSSOToken. Write the updated token to the SMSESSION cookie.

Lists containing the Attribute class are used by this method. The only fields in this class that are used with this method are id and value.

To create a token, call createSSOToken().

Parameters:
SSOToken - The single sign-on token to be decoded. The custom agent finds the token in either of these locations:
  • If the token was created by a custom agent, the token is returned in the output parameter SSOToken from the call to createSSOToken().
  • If the token was created by a standard SiteMinder Web Agent, the token is contained in the SMSESSION cookie. The custom agent is responsible for extracting the contents of the cookie and assigning it to this parameter.
td - On return, this parameter contains the token version number and specifies whether the token was created by a custom agent.
al - On return, this parameter contains the attributes extracted from the token. Valid values:
  • ATTR_USERDN. The user's distinguished name.
  • ATTR_SESSIONSPEC. The session specification returned from the login call.
  • ATTR_SESSIONID. The session ID returned from the login call.
  • ATTR_USERNAME. The user's name.
  • ATTR_CLIENTIP. The IP address of the machine where the user initiated a request for a protected resource.
  • ATTR_DEVICENAME. The name of the agent that is decoding the token.
  • ATTR_IDLESESSIONTIMEOUT. Maximum idle time for a session.
  • ATTR_MAXSESSIONTIMEOUT. Maximum time a session can be active.
  • ATTR_STARTSESSIONTIME. The time the session started after a successful login.
  • ATTR_LASTSESSIONTIME. The time that the Policy Sever was last accessed within the session.
UpdateToken - true if an updated token is requested.
UpdatedSSOToken - On return, this parameter contains the updated token. Write this token to the SMSESSION cookie. The token is returned only if UpdateToken is true.
Returns:
  • SUCCESS. The operation succeeded.
  • FAILURE. The token was not decoded.
  • NOCONNECTION. There was no connection to the Policy Server.
  • INVALID_ATTRLIST. The attribute list is invalid.
Since:
SDK 2.2

SiteMinder
Java SDK r12.0 SP2

Fri 11/06/2009

http://ca.com
Copyright (c) 2009 CA.