Authorizers API
An authorizer decides who can open the playlist of a channel. A channel uses an authorizer with its authorizer field. Read more about the methods and their priority in Authorizers.
All requests of this page are available to the admin role only.
Authorizer Object
Section titled “Authorizer Object”{ "id": "token-auth", "ip": ["allow 192.168.0.0/24", "deny 10.0.0.1"], "securetoken": "my-secret", "backend": ["http://auth.example.com/check"], "default": "deny"}- id: Authorizer ID. Only in the create request.
- ip (optional): List of rules in the format
<action> <address>. Read more in IP. - securetoken (optional): The secret for Securetoken.
- backend (optional): List of URLs of your HTTP backend.
- default: What to do when no method decided:
allow,deny, orpass. Always set it.
Create an Authorizer
Section titled “Create an Authorizer”POST /api/ott/authorizerExample:
curl -sS -X POST -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ 'http://alta.example.com:8100/api/ott/authorizer' \ -d '{"id": "token-auth", "securetoken": "my-secret", "default": "deny"}'Returns 204, or 409 if an authorizer with this ID exists.
Get an Authorizer
Section titled “Get an Authorizer”GET /api/ott/authorizer?id=<authorizer_id>Returns the authorizer object without the id field, or 404.
Update an Authorizer
Section titled “Update an Authorizer”PUT /api/ott/authorizer?id=<authorizer_id>Send the complete object. A method you omit is removed from the authorizer. Returns 204, or 404.
Delete an Authorizer
Section titled “Delete an Authorizer”DELETE /api/ott/authorizer?id=<authorizer_id>Remove the authorizer from the channels first with Update a Channel, so no channel refers to an authorizer that does not exist. Returns 204, or 404.
Generate a Securetoken
Section titled “Generate a Securetoken”GET /api/ott/securetoken?id=<authorizer_id>&path=<path>&ip=<ip>&start=<time>&end=<time>Calculates the token for one viewer. Use it when your middleware does not calculate the token itself. The authorizer must have the securetoken secret.
- id: Authorizer ID.
- path: Path of the playlist, exactly as the viewer requests it, for example
/news/index.m3u8. - ip: IP address of the viewer.
- start, end: The time when the token starts and stops to work, in the RFC 3339 format, for example
2026-11-07T10:00:00Z.
Example:
curl -sS -G -H "Authorization: Bearer $TOKEN" \ 'http://alta.example.com:8100/api/ott/securetoken' \ --data-urlencode 'id=token-auth' \ --data-urlencode 'path=/news/index.m3u8' \ --data-urlencode 'ip=203.0.113.5' \ --data-urlencode 'start=2026-11-07T10:00:00Z' \ --data-urlencode 'end=2026-11-07T12:00:00Z'Response: the token as a JSON string:
"e8bff06f373694dda657e8417fe76f6b54b69807-a5cd6c00-1794052800-1794045600"Add the token to the playlist URL:
http://alta.example.com:8101/news/index.m3u8?token=e8bff06f373694dda657e8417fe76f6b54b69807-a5cd6c00-1794052800-1794045600| Code | Description |
|---|---|
200 | The token |
400 | A time is not in the RFC 3339 format |
404 | The authorizer does not exist, or it has no securetoken |