Skip to main content

Authentication

The authentication service is used to create auth_tokens which can be used to connect to the Secure Stream Recording Service. Three endpoints exist, which assign different permissions to the new auth_token.

Client-Session Auth Request

Use the master-key to create a new auth_token for a new or existing client.

POST /auth_v2/client
Request ParametersTypeDescription
client_idString (required)ClientID tied to this token. The clientID can be freely chosen.
master_keyString (required)Master key of this account.
token_ttl_sInt (optional)TTL of the token in seconds. Defaults to 86400 (i.e. 24h).

Example request:

{
"master_key": "******",
"client_id": "c-0",
"token_ttl_s": 3600
}

Returns 201 on success.

Response ParametersTypDescription
auth_tokenString (required)A JWT auth token.

Example response:

{
"auth_token": "********"
}

Supervisor Auth Request

A supervisor is monitoring a client-id. In order to create a token for that purpose, the client-id to be monitored hast to be supplied.

POST /auth_v2/supervisor
Request ParametersTypeDescription
client_idString (required)ClientID (=SupervisorID) tied to this token. The clientID can be freely chosen.
master_keyString (required)Master key of this account.
client_to_monitorString (required)ClientID of the client to be monitored.
token_ttl_sInt (optional)TTL of the token in seconds. Defaults to 86400 (i.e. 24h).

Example request:

{
"master_key": "******",
"client_id": "s-0",
"client_to_monitor": "c1",
"token_ttl_s": 3600
}

Returns 201 on success.

Response ParametersTypDescription
auth_tokenString (required)A JWT auth token.

Example response:

{
"auth_token": "********"
}

Stats Interface Auth Request

POST /auth_v2/stats
Request ParametersTypeDescription
client_idString (required)ClientID tied to this token. The clientID can be freely chosen.
master_keyString (required)Master key of this account.
token_ttl_sInt (optional)TTL of the token in seconds. Defaults to 86400 (i.e. 24h).

Example request:

{
"master_key": "******",
"client_id": "c-0",
"token_ttl_s": 3600
}

Returns 201 on success.

Response ParametersTypDescription
auth_tokenString (required)A JWT auth token.

Example response:

{
"auth_token": "********"
}

Using the token

The token is to be used via authorization header or carried via query param auth_token:

curl -H "Authorization: Bearer <token>" http://streamrec.eyeson.com/session

or

curl http://streamrec.eyeson.com/session?auth_token=<token>