12.07.2015 Views

CA eTrust SiteMinder Developer's Guide for Java

CA eTrust SiteMinder Developer's Guide for Java

CA eTrust SiteMinder Developer's Guide for Java

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Java</strong> API FlowYou might already have a session specification <strong>for</strong> a user that has beenauthenticated. For example, you have written a custom agent and obtained asession specification using the <strong>Java</strong> Agent API. To make DMS API calls as auser, you can use that session specification. You need not obtain a newsession specification.To use an existing session, create an SmApiSession object and associate thesession specification with that object.Log in as a <strong>SiteMinder</strong> AdministratorTo authenticate a <strong>SiteMinder</strong> administrator, use the login() method in theSmApiSession class of the Utilities package. This method uses theadministrator’s login credentials (username and password) to authenticate theadministrator. Calling this login() method obtains a session specification andreturns an SmApiResult object.The syntax of the login() method is as follows:result=mySession.login (username,password,IPaddress,challengeReason);Provide a value <strong>for</strong> the challengeReason parameter as follows:■■On the administrator’s initial login, set challengeReason to 0 (no reason).If the initial login fails, use challengeReason in the next login() call tospecify the results of the previous authentication attempt.To retrieve the reason value to assign to challengeReason, callgetReason() in the SmApiResult object.To obtain a new session specification <strong>for</strong> a user, use the <strong>Java</strong> Agent API toobtain a session specification. Then, create an SmApiSession object andassociate the session specification with that object.22 <strong>Developer's</strong> <strong>Guide</strong> <strong>for</strong> <strong>Java</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!