Authentication Resource

The Authentication API accepts the same user credentials as the Waterline Data browser. These API calls control the creation and destruction of a session cookie to validate other API calls.

POST /v2/login

A POST call to the /login endpoint creates a login session cookie that is valid for the UI timeout duration (a default time of 120 minutes).

Request Body
media type data type description
application/json Credentials (JSON) Credentials consist of username and password.
Response Body
media type data type description
application/json LoginResponse (JSON) Consists of loginResult, message, and userInfo.

Example

Request
POST /v2/login
Content-Type: application/json
Accept: application/json

                
{
  "username" : "...",
  "password" : "..."
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "loginResult" : "SUCCESS",
  "message" : "...",
  "userInfo" : {
    "username" : "...",
    "displayName" : "..."
  }
}
                
              

GET /v2/logout

Destroys the session cookie and returns a logout confirmation message.

Response Body
media type data type description
application/json LogoutResponse (JSON) A generic message string stating "User logged out" or "User not logged in".

Example

Request
GET /v2/logout
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "redirectUrl" : "...",
  "message" : "..."
}