Do file-based RTMP authentication with URL query strings (OnConnectAuthenticate2)

The OnConnectAuthenticate2 module is a file-based username/password authentication method for use with Flash applications that connect to Wowza Streaming Engine™ media server software. It uses query parameters in the RTMP URL to connect to server software. It can be used with live sources (encoders or cameras) that don't support RTMP authentication.

Contents


Prerequisites
Installation
Configuration
Properties
Usage
For developers

Prerequisites


Wowza Streaming Engine 4.0.0 or later is required.

Notes:
  • If using this module, the RTMP Sources setting in your application's Source Security page must be set to Open (no authentication required).
     
  • When this module is enabled, all RTMP sources must provide a user name and password as query parameters in the RTMP URL.

Installation


  1. Download wse-plugin-onconnectauthenticate.zip.
     
  2. Extract the contents from the downloaded (zipped) package, and then copy the lib/wse-plugin-onconnectauthenticate.jar file from the package to the lib folder in your Wowza Streaming Engine installation ([install-dir]/lib).
     
  3. Restart Wowza Streaming Engine.

Configuration


To enable this module, add the following module definition to your application. See Configure modules for details.

Name
Description
Fully Qualified Class Name
ModuleOnConnectAuthenticate Authenticates RTMP in Flash. com.wowza.wms.plugin.OnConnectAuthenticate2

Properties


After enabling the module, you can adjust the default settings by adding the following properties to your application. See Configure properties for details.

Path
Name
Type
Value
Notes
/Root/Application rtmpAuthenticateFile String ${com.wowza.wms.context.VHostConfigHome}/
conf/connect.password
Path to password file that is used to authenticate connections. (default: ${com.wowza.wms.context.VHostConfigHome}/
conf/connect.password
)
/Root/Application usernamePasswordProviderClass String com.example.MyCustomClass Fully qualified class name of a custom class that is used to resolve passwords. (default: not set)

Usage


This module uses its own password file named connect.password. By default, this file should be in the [install-dir]/conf folder. The name and location of this file can be configured using the rtmpAuthenticateFile property.

To configure the location where this file is stored:

  1. Create a text file named connect.password in the [install-dir]/conf folder.
     
  2. Edit [install-dir]/conf/connect.password and add at least one line with a username and password pair (separate each username and password with a space):
    user1 pass1
    user2 pass2
  3. Save and close the file.

The RTMP URL that you use must include the username and password as query parameters. The username is the first parameter and the password is the second parameter. For example:

rtmp://[wowza-ip-address]:1935/live/?user1&pass1

For developers


  • Get the source code on GitHub