Using Apache's Basic Authentication with IsmProxyPass

Table of Contents

This module is compiled by default, it does not require an extra installation.

Server

It is mandatory to create a password file and add the user credentials. This credentials will be used on the file requests.

#!/bin/bash

sudo htpasswd -c /etc/apache2/.basicauth basicauthuser

Once you execute the command above, a password will be asked. Type your password and the file will be created in the Apache folder. You don't have to create the files in the Apache folder, it can be stored any folder but only the same server Apache had installed.

We will be securing our content in the directory /secure. In this tutorial we also use one of the Unified Streaming S3 Bucket for the IsmProxyPass target. Add the below configuration into your Virtual Host.

<Location "/secure">
  AuthType basic
  AuthName "private area"
  AuthUserFile    "/etc/apache2/.basicauth"
  Require            valid-user
</Location>

<Directory "/var/www/tears-of-steel/secure" >
  IsmProxyPass http://usp-s3-storage.s3-eu-central-1.amazonaws.com/
</Directory>

Note

The example configuration would only work if your Virtual Host's document root configured as "/var/www/tears-of-steel".

Restart your Apache server after all the changes are saved.

Client

A client now make a request only with using the authentication credentials to get the target files.

#!/bin/bash

sudo curl -v -u basicauthuser:yourpassword "http://your_server_address/secure/tears-of-steel/tears-of-steel.ism/.mpd

Notes

You don't have to create any folders into your Apache document root folder. The web server will translate the proxy request without a physical folder.

Apache basic authentication works with a standard Unified Origin installation.

This installation will only secure the folder stated in the configuration. Rest of the files can be requested from your web server without any authentication.