Start session

Initialisation through the Comapi (RxComapi) class gives you access to client objects used for any further communication with the SDK.

Learn more in Initialise.

In order to communicate with our services you must start session in the SDK. You only need to do this once per user log in. After that, the SDK re-authenticates the session until you end it.


Start

To create or log in user to our services:

client.service().session().startSession(new Callback<Session>(){/* implement */});
rxClient.service().session().startSession()
   .subscribe(new Observer<Session>(){/* implement */});

This asks ComapiAuthenticator (provided when initialising) for a JWT token, then the SDK creates a session server side for the profile ID obtained from the token. Any subsequent call to the services uses the same authentication details.


Stop

To close a currently opened session:

client.service().session().endSession(
   new Callback<ComapiResult<Void>>(){/* implement */});
rxClient.service().session().endSession()
   .subscribe(new Observer<ComapiResult<Void>>(){/* implement */});