Securetoken

    This technology allows to protect streams from illegal viewing with the help of temporary tokens

    1. Go to the tab Settings -> HTTP Authentication and set the checkbox in the field Enable built-in HTTP/HLS authentication (restart required). After this action - in the SECURETOKEN come up with our secret key. For example - the word test Image Save the settings and restart Astra.

    2. Go to the console of our server and download the example token generator: securetoken.php
      cd /tmp
      wget http://cesbo.com/download/astra/scripts/auth/http-backend/securetoken.php
      

      Edit the file: in the variable $key = 'SECRETKEY' we will write our secret word - 'test' Image Save the changes and run token-generator: (Note: PHP must be installed on the server!)

      php -S 0:81 /tmp/securetoken.php
      
    3. Lets go to the settings of any of our stream. We need his ID:
      Image In the example it is a stream with id a01 and hls-output at http://0:8002/test.m3u8. Remember his ID.
      After enabling authorization, the stream will require a token for authorization. Create a token:
      Open a web browser and in the url bar - execute a request to token-generator :
      http://server_ip:81/?stream=a01 (where a01 is the ID of our test stream). we will receive a token with a lifetime of 3 hours:
      Image Each new request to the generator will generate unique tokens.
      Now, to view the stream - we will use the link:
      http://server_ip:8002/test.m3u8?token=d5c55f937f3b14a563889af7defdb452e4e22309-eb77c133b8068a19049566ce5dfe8d33-1561464903-1561453803
      That is, a token is added to the stream address.