Flussonic Authorization Backend API (21.12.1)

Download OpenAPI specification:Download

This API describes how Flussonic streaming server connects to an external authorization backend to check if the user is allowed to access a stream or a VOD file.

Permanent download link to JSON schema file.

This specification does not have any external dependencies and is designed to be as minimal, as possible for reducing needs of maintaining unneeded backward compatibility.

This API is designed to be implementable by third parties.

auth

Play session authorization

This method describes what Flussonic sends to an authorization backend for playing session and what it awaits as a response.

Authorizations:
bearerAuth
query Parameters
name
required
string
Example: name=fake

Stream or VOD file name for this session.

proto
required
string
Example: proto=hls

Protocol for this session.

ip
required
string
Example: ip=10.77.0.150

IP address of the media client who initiated this session.

request_type
required
string
Enum: "new_session" "update_session"
Example: request_type=new_session

Is it a request for a new session or an update request.

The value new_session is used for a start of a new session and update_session - for an existing session.

request_number
required
integer <bytes>
Example: request_number=1

Counter of auth requests for this session, starting from 0.

session_id
required
string <uuid>
Example: session_id=6217fd62-16da-4206-9da9-0173d7552a14

Unique session id. It will be the same for one session.

stream_clients
required
integer
Example: stream_clients=1

How many clients are currently watching this stream or VOD file.

total_clients
required
integer
Example: total_clients=2

How many clients are currently watching from this server.

token
string
Example: token=60334b207baa

User provided authorization token.

The token is generated automatically or received from a website.

duration
integer <seconds>
Example: duration=2

If it is an update request, then it will be the duration of this session in seconds.

bytes
integer <bytes>
Example: bytes=12345

How many bytes have been passed in this session.

qs
string
Example: qs=token=60334b207baa

Here may go initial query string that was passed by client. Use it for additional authorization.

dvr
boolean
Example: dvr=true

Is it a session for playing DVR archive.

user_agent
string
Example: user_agent=curl%2F7.68.0

Many protocols can signal a user agent. It will be provided in this field.

referer
string
Example: referer=hey.com

Referer HTTP header that identifies the address of the web page from which the request was made.

host
string
Example: host=streamer03.my.cdn

A value of Host HTTP Header.

Responses

Response samples

Content type
application/json
{
  • "ad_inject": {
    },
  • "allowed_dvr_ranges": [
    ]
}

Publish session authorization

This method describes what Flussonic sends to an authorization backend for publishing session authorization and what it awaits as a response.

Authorizations:
bearerAuth
Request Body schema: application/json
name
object

Stream name for this session.

proto
object

Protocol for this session.

ip
object

IP address of the media client who initiated this session.

request_type
object
Deprecated Delete at: 25.08

Is it a request for a new session or an update request.

The value new_session is used for a start of a new session and update_session - for an existing session.

request_number
object
Deprecated Delete at: 25.08

Counter of auth requests for this session, starting from 0.

session_id
object
Deprecated Delete at: 25.08

Unique session id. It will be the same for one session.

stream_clients
object
Deprecated Delete at: 25.08

How many clients are currently watching this stream.

total_clients
object
Deprecated Delete at: 25.08

How many clients are currently watching from this server.

token
object

User provided authorization token.

The token is generated automatically or received from a website.

duration
object
Deprecated Delete at: 25.08

If it is an update request, then it will be the duration of this session in seconds.

bytes
object
Deprecated Delete at: 25.08

How many bytes have been passed in this session.

qs
object

Here may go initial query string that was passed by client. Use it for additional authorization.

user_agent
object

Many protocols can signal a user agent. It will be provided in this field.

referer
object

Referer HTTP header that identifies the address of the web page from which the request was made.

host
object

A value of Host HTTP Header.

Responses

Request samples

Content type
application/json
{
  • "name": "fake",
  • "proto": "hls",
  • "ip": "10.77.0.150",
  • "request_type": "new_session",
  • "request_number": 1,
  • "session_id": "6217fd62-16da-4206-9da9-0173d7552a14",
  • "stream_clients": 1,
  • "total_clients": 2,
  • "token": "60334b207baa",
  • "duration": 2,
  • "bytes": 12345,
  • "qs": "token=60334b207baa",
  • "user_agent": "curl%2F7.68.0",
  • "referer": "hey.com",
  • "host": { }
}

Response samples

Content type
application/json
{
  • "ad_inject": {
    },
  • "allowed_dvr_ranges": [
    ]
}