Skip to content

How to configure two auth backends

If you are already using IPTV Middleware like IPTVportal, Stalker or anything else, you can meet a situation when you need to add some exceptions to authorization.

For example, you want to share a stream with your partner via a password-protected link, but you do not want to modify Middleware code.

This document will show you how to solve this problem inside Flussonic Media Server by writing a small block in the configuration file.

Authorization backend with exceptions

We will assume that your Middleware has an auth backend script with the following URL: http://iptv.myservice.com/auth.php

You want to share the link to your stream with password PASS and to allow access from the local network 192.168.1.0/24.

Add these lines to the file /etc/flussonic/flussonic.conf:

auth_backend main {
  allow ip 192.168.1/24;
  allow token PASS;
  backend http://iptv.myservice.com/auth.php;
}
stream example {
  input fake://fake;
  on_play auth://main;
}

First we check the IP address and client token. If they do not fit, then we go to the original backend.

To use this authorization backend (main) for the stream, specify auth://main.

The related section in the UI is the tab Auth in stream settings, which you can click after you open the stream.

Flussonic multi-authorization

You can configure two different auth backends in the same manner.

Two auth backends

auth_backend parallel {
  backend http://examplehost.iptvportal.ru/auth/flussonic/arescrypt/;
  backend http://stalker/stalker_portal/server/api/chk_flussonic_tmp_link.php;
}
stream cnn {
  input udp://239.255.0.1:1234;
  on_play auth://parallel;
}

In this case, Flussonic carries out parallel authorization on several HTTP-backends.

See more about the auth configurator.