The following operation is supported on this resource:

  • POST - Login to Space, creating a REST API Client Session which can be used for subsequent REST API requests
POST /login Version 1

This API creates a new user session in Space. The user session can be subsequently used to call other REST APIs, using a standard HTTP Client like Apache HTTP 4.2.3 for Java, or Requests client in Python. The session protocol uses a standard Request Session, which sets persistent cookies JSESSIONID and JSESSIONIDSSO returned by this API. Once these two cookies are set on the client, then any subsequent request using the same HTTP client will use the created session. The use of this API will benefit overall API performance, especially, when long API sessions are created with many HTTP requests.

To use the API, pass either a Basic Authorization header with username/password credentials or an X.509 certificate, just as with all other REST APIs. After the server authenticates the request, it will create a new REST API session for the client. Once the session has been created, subsequent HTTP requests no longer need to present any credentials or certificates to the server. Only the JSESSIONID and JSESSIONIDSSO need to be presented, and will automatically be presented by most HTTP clients, if these session cookies are set on the client host.

If the session login is successful, this API will return an HTTP header like this:

Set-Cookie: JSESSIONIDSSO=hiPw0L...;Version=1, JSESSIONID=z+dhXM...;Version=1; Path=/api/space/user-management

with a response body of:

                        User logged in

It will also return an HTTP Error Code of 200 (Success).

If the provided credentials are invalid, the login will be unsuccessful, and a 401 (Unauthorized) Error Code will be returned, along with the response body of:

                        User is not logged in

The user session will be actively maintained on the server, until, either:

  • Client explicitly logs out using the /api/space/user-management/logout API.
  • Session is terminated by the system due to inactivity. The default session maxage (or idle-time) limit is 30 minutes. This value can also be set, dynamically, by using the maxage parameter on this API.