Session-Based Authentication
Kraken uses Session-Based Authentication where session data is conveyed within the cookie portion of an HTTP header request.
Kraken enforces that all interactions with it and the API are performed over secure HTTP (i.e., HTTPS). Certificates are required to enable secure communications between the Kraken server and remote clients, and some environments may require certificates NOT be self signed. In these situations, Kraken allows a Kraken Administrator to Manage Certificates on the Kraken appliance.
In addition to enforcing API interaction over HTTPS, all API requests must also be authenticated. This requires the end user application exercising the Kraken API to authenticate against the login endpoint.
Upon logging in with valid username and password credentials on the /apis/v2/login endpoint, the Kraken server will respond with a 204 (No Content) success status response code, and set a cookie with session data.
Example
To demonstrate this with the curl command line application, the following example performs the login action to a remote Kraken server using an example password of krakenapi for the haiadmin administrator user:
Note
The default password for the Kraken server is provided in the Important Notice postcard, which is shipped with the device or available from the Download Center on the Haivision Support Portal.
|
|---|
Curl sends this request:
|
|---|
And the Kraken response:
|
|---|
The session cookie data is provided in the id parameter. By using the -c cookie.txt curl command, curl writes the cookie data to a file.
Subsequent API requests can now use that stored cookie in cookie.txt to interact with Kraken in an authenticated manner.
For instance, now that the cookie is saved, use it with curl as:
|
|---|
Additional information about the programming interfaces available within Kraken are discussed in (4.0) Accessing API v2.0 Documentation.
Refer to your HTTP protocol tool documentation for how it handles cookie storage and inclusion back in HTTP header requests.