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 Parameters | Type | Description |
---|---|---|
client_id | String (required) | ClientID tied to this token. The clientID can be freely chosen. |
master_key | String (required) | Master key of this account. |
token_ttl_s | Int (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 Parameters | Typ | Description |
---|---|---|
auth_token | String (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 Parameters | Type | Description |
---|---|---|
client_id | String (required) | ClientID (=SupervisorID) tied to this token. The clientID can be freely chosen. |
master_key | String (required) | Master key of this account. |
client_to_monitor | String (required) | ClientID of the client to be monitored. |
token_ttl_s | Int (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 Parameters | Typ | Description |
---|---|---|
auth_token | String (required) | A JWT auth token. |
Example response:
{
"auth_token": "********"
}
Stats Interface Auth Request
POST /auth_v2/stats
Request Parameters | Type | Description |
---|---|---|
client_id | String (required) | ClientID tied to this token. The clientID can be freely chosen. |
master_key | String (required) | Master key of this account. |
token_ttl_s | Int (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 Parameters | Typ | Description |
---|---|---|
auth_token | String (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>