# Per-application authentication using API

**URL:** <https://community.wowza.com/t/per-application-authentication-using-api/46602>\
**Category:** Wowza Developer Dojo\
**Created:** [May 5, 2016, 10:13am UTC](https://community.wowza.com/t/per-application-authentication-using-api/46602 "2016-05-05T10:13:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nejc\_Campa](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@Nejc\_Campa](https://community.wowza.com/u/Nejc_Campa)\
**Post date:** [May 5, 2016, 10:13am UTC](https://community.wowza.com/t/per-application-authentication-using-api/46602/1 "2016-05-05T10:13:20Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [May 12, 2016, 3:37pm UTC](https://community.wowza.com/t/per-application-authentication-using-api/46602/2 "2016-05-12T15:37:50Z")

</div>

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/](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](https://www.wowza.com/docs/how-to-access-documentation-for-wowza-streaming-engine-rest-api) to access and test the various endpoints if you haven’t already.

Paul

---

<div class="post-metadata">

**Author:** ![Nejc\_Campa](https://avatars.discourse-cdn.com/v4/letter/n/13edae/32.png) [@Nejc\_Campa](https://community.wowza.com/u/Nejc_Campa)\
**Post date:** [May 13, 2016, 3:19pm UTC](https://community.wowza.com/t/per-application-authentication-using-api/46602/3 "2016-05-13T15:19:05Z")

</div>

Thanks for your answer. It works! 🙂

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
