# User authentication Problem via CURL Command

**URL:** <https://community.wowza.com/t/user-authentication-problem-via-curl-command/47178>\
**Category:** Wowza Developer Dojo\
**Created:** [June 19, 2016, 12:59pm UTC](https://community.wowza.com/t/user-authentication-problem-via-curl-command/47178 "2016-06-19T12:59:50Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![sanjay\_yadav](https://avatars.discourse-cdn.com/v4/letter/s/ee7513/32.png) [@sanjay\_yadav](https://community.wowza.com/u/sanjay_yadav)\
**Post date:** [June 19, 2016, 12:59pm UTC](https://community.wowza.com/t/user-authentication-problem-via-curl-command/47178/1 "2016-06-19T12:59:50Z")

</div>

Hi Guys,

I know this is not the Programming forums but this forums is related to the wowza and my question is totally related to the WOWZA.

I have check this JSON String

[https://www.wowza.com/forums/content…sh-publishing](https://www.wowza.com/forums/content...sh-publishing))

```auto
<?php
$username = 'test';
$password = 'test';
$data = array(
"restURI" => "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/myStream/pushpublish/mapentries/ppsource",
"serverName" => "_defaultServer_",
        "sourceStreamName" => "myStream",
        "entryName" => "RTMP",
        "profile" => "rtmp",
        "host" => "rtmp",
        "application" => "myStream",
        "streamName"=> "test",
        "userName" => "",
        "password"=> "",
        "debugPackets"=>"true",
        "sendReleaseStream"=>"false",
        "sendStreamCloseCommands"=>"false",
        "debugLog"=>"true",
        "destinationName"=>"rtmp",
        ); 
    $data_string = json_encode($data);
$url = 'http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/myStream/pushpublish/mapentries/ppsource';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data_string))
);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_USERPWD, $username . ':' . $password);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec( $ch );
echo $result;
echo "data";

```

ERROR:

```auto
HTTP/1.1 401 Unauthorized
        Content-Type: text/xml; charset=UTF-8
        Date: Fri, 17 Jun 2016 18:43:07 GMT
        Accept-Ranges: bytes
        Server: Restlet-Framework/2.2.2
        WWW-Authenticate: Digest realm="Wowza", domain="/", nonce="dfsdfdfsdfsdfsdfsdfsdfTRlYjE1ZTgzZGYxODFmODQyZjYwYg=="algorithm=MD5, qop="auth"
        Connection: keep-alive
        Transfer-Encoding: chunked
       <?xml version="1.0" encoding="UTF-8" standalone="no"?><error><wowzaServer>4.2.0 < /wowzaServer><code>401</code><message>The request requires user authentication</message></error>data</body>
*<message>The request requires user authentication</message>*

```

I am getting

```auto
USER Authentication problem

```

any help will apprenticed.

THANKS in advance.

---

_[View the full topic](https://community.wowza.com/t/user-authentication-problem-via-curl-command/47178)._
