How it works
Thered5pro-simple-auth-plugin intercepts every incoming connection to your Red5 Pro application. When a client connects to publish or subscribe, the plugin extracts the username and password parameters and checks them against a credential store. If the credentials match, the connection proceeds; otherwise, Red5 Pro rejects it.
You can choose between two credential stores:
In-memory (properties file)
Credentials are loaded from
RED5_HOME/conf/simple-auth-plugin.credentials at startup and held in memory. Changes require a server restart.File validator (per-app)
Each application can point to its own credentials file inside its
WEB-INF directory, giving you isolated credential sets per app.Step 1 — Configure the plugin
The global plugin settings live inRED5_HOME/conf/simple-auth-plugin.properties. By default, the plugin is inactive server-wide; you enable it per-application using the application-level bean (see step 2).
If you set
simpleauth.default.active=true, every application on the server
requires authentication. Leave it false to enable authentication
selectively per application.Step 2 — Enable authentication for an application
Add thesimpleAuthSecurity bean to your application’s context file. For the built-in live application, that file is RED5_HOME/webapps/live/WEB-INF/red5-web.xml.
simple-auth-plugin.properties.
Bean properties reference
| Property | Type | Description |
|---|---|---|
active | Boolean | Enables or disables authentication for this application |
rtmp | Boolean | Enforces authentication on RTMP connections |
rtsp | Boolean | Enforces authentication on RTSP connections |
rtc | Boolean | Enforces authentication on WebRTC connections |
rtmpAllowQueryParamsEnabled | Boolean | Allows RTMP clients to pass credentials in the URL query string |
allowedRtmpAgents | String | Semicolon-separated list of permitted RTMP agent strings; * allows all |
validator | Reference | Bean reference to a custom validator (omit to use the default file validator) |
Step 3 — Add credentials
EditRED5_HOME/conf/simple-auth-plugin.credentials. Each line holds one username/password pair separated by a single space.
Step 4 — Connect clients with credentials
Clients must includeusername and password as connection parameters. The plugin extracts and validates these values before the publish or subscribe action is allowed.
- WebRTC (HTML5 SDK)
- RTMP (ActionScript)
- RTSP — Android
- RTSP — iOS
- RTMP — FFmpeg
Pass credentials via the
connectionParams property of your base configuration object.Using a per-application credentials file
To keep credentials isolated for a specific application, configure a custom file validator bean and point it at a credentials file inside the application’sWEB-INF directory.
Copy the credentials file
Copy
RED5_HOME/conf/simple-auth-plugin.credentials to
RED5_HOME/webapps/live/WEB-INF/simple-auth-plugin.credentials and
add the credentials for this application.Cluster support
When you run a Red5 Pro cluster, thecluster-restreamer process that replicates streams from origin to edge nodes is itself a connecting client. When Simple Authentication is active, you must allow the restreamer to authenticate.
Add the following entry to your credentials file on every node:
RED5_HOME/conf/cluster.xml. This ensures the restreamer can authenticate just like any other client.
When to use Simple Authentication
Good fits
Good fits
- Small deployments with a fixed set of known publishers and subscribers
- Two-way chat applications where every participant has a credential pair
- Internal or staging environments where ease of setup matters more than scalability
- Situations where you need to know who is connecting (named users)
Poor fits
Poor fits
- Applications with anonymous or dynamic user bases (no fixed credentials)
- One-to-many broadcasts where you need to distinguish publishers from a large subscriber audience — consider JWT Authentication or Round-Trip Authentication instead
- Large deployments that require per-user access control without restarting the server to reload credentials
