Previous Topic: Establish a User-Defined Connection to the Policy Server

Next Topic: Log in as a SiteMinder Administrator

Obtain a Session

After you obtain a connection to the Policy Server, get a user or administrator session.

Note: To use the Policy Management API, you must connect as a SiteMinder Administrator.

After you obtain a session object, pass it to the Policy Management API or the DMS API through the constructor for the SmPolicyApiImpl class, or the SmDmsApiImpl class.

To obtain a session, perform one of these actions:

If...

And...

Then...

You have an existing session from authenticating a user.

Pass in the session specification for the authenticated user.

You do not have an existing session.

You must connect as a SiteMinder Administrator.

Use the method SmApiSession.login().

You do not have an existing session.

You want to connect as a non-Administrator.

Use the Java Agent API to obtain a session specification for the user.

If you have a session specification for a user that has been authenticated, you can use that session specification. You need not obtain a new session specification.

To use an existing session, create an SmApiSession object and associate the session specification with that object.