Wowza Community

Per-application authentication using API

Hi all,

We are using custom build web portal for creating applications on wowza using REST API.

I would like to set per-application authentication with rest api when creating new application on wowza. Following manual (https://www.wowza.com/docs/how-to-enable-username-password-authentication-for-rtmp-and-rtsp-publishing) and despite lack of api docmentation i managed to add required custom property using rest with setting “publishPasswordFile” inside securityConfig

securityConfig": {

“publishPasswordFile”: “${com.wowza.wms.context.VHostConfigHome}/conf/${com.wowza.wms.context.Application}/publish.password”,

Now I need to create publish.password file within application directory. Is this possible with rest api? Is there any other solution how to set per-application authentication using rest api?

Thanks,

Nejc

Hi,

Once you’ve configured your application with its own publish.password file and location then you can populate it with a call similar to this:

[php]

curl -X POST --header ‘Accept:application/json; charset=utf-8’ --header ‘Content-type:application/json; charset=utf-8’ http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/myapp/publishers -d’

{

“publisherName”: “username”,

“password”:“password”

}’

[/php]

[edit]

By the way, I’d recommend installing the Swagger UI to access and test the various endpoints if you haven’t already.

Paul

Thanks for your answer. It works! :slight_smile:

I’m already using Swagger. It is nice tool for testing. But sometimes, there is a lot of options to set and some good documentation would be much appreciated.

Nejc