# HTTPProvider and Basic HTTP authentication

**URL:** <https://community.wowza.com/t/httpprovider-and-basic-http-authentication/39852>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [January 22, 2013, 4:15pm UTC](https://community.wowza.com/t/httpprovider-and-basic-http-authentication/39852 "2013-01-22T16:15:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kor\_Ceritor](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@Kor\_Ceritor](https://community.wowza.com/u/Kor_Ceritor)\
**Post date:** [January 22, 2013, 4:15pm UTC](https://community.wowza.com/t/httpprovider-and-basic-http-authentication/39852/1 "2013-01-22T16:15:03Z")

</div>

Hi!

I’m writing a Wowza extension in a form of a custom HTTPProvider and I’m trying to use basic authorization… The problem is that when I test my REST “api” with WRONG credentials a NPE is thrown inside doHTTPAuthentication. When I supply the CORRECT credentials, doHTTPAuthentication returns TRUE, as expected. DIGEST authentication on the other hand works flawlessly.

Why do I need to use basic and not digest authentication is a matter for another discussion. 🙂

**Stack trace:**

```auto
==> logs/wowzamediaserver_access.log <==
2013-01-22 12:24:47 CET comment server ERROR 500 - java.lang.NullPointerException
        at com.wowza.wms.authentication.AuthenticateBasic.authenticateHTTPProvider(Unknown Source)
        at com.wowza.wms.http.HTTProvider2Base.doHTTPAuthentication(Unknown Source)
        at org.company.video.wms.module.RestApi.onHTTPRequest(RestApi.java:32) <- my class
        at com.wowza.wms.http.HTTPRequestAdapter.service(Unknown Source)
        at com.wowza.wms.server.ServerHandler.a(Unknown Source)
        at com.wowza.wms.server.ServerHandler.a(Unknown Source)
        at com.wowza.wms.server.ServerHandler.messageReceived(Unknown Source)
        at com.wowza.wms.server.ServerHandlerThreaded.messageReceived(Unknown Source)
        at org.apache.mina.common.support.AbstractIoFilterChain$2.messageReceived(Unknown Source)
        at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Unknown Source)
        at org.apache.mina.common.support.AbstractIoFilterChain.access$900(Unknown Source)
        at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(Unknown Source)
        at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(Unknown Source)
        at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(Unknown Source)
        at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Unknown Source)
        at org.apache.mina.common.support.AbstractIoFilterChain.access$900(Unknown Source)
        at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceived(Unknown Source)
        at org.apache.mina.filter.executor.ExecutorFilter.processEvent(Unknown Source)
        at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

```

I’m using HTTProvider2Base.doHTTPAuthentication in this way:

```auto
[B]if (!doHTTPAuthentication(vhost, request, response)) {[/B]

```

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [January 24, 2013, 3:37pm UTC](https://community.wowza.com/t/httpprovider-and-basic-http-authentication/39852/2 "2013-01-24T15:37:48Z")

</div>

You have to set the AuthenticationMethod of the HTTPProvider to “admin-basic”, then restart Wowza. Then load using http url like this form

```auto
http://richard:myPwd@[wowza-address]:1935/filterName

```

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [January 28, 2013, 1:35pm UTC](https://community.wowza.com/t/httpprovider-and-basic-http-authentication/39852/3 "2013-01-28T13:35:33Z")

</div>

I see that too. Thanks for the report and clarification. I will forward to engineering

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [January 28, 2013, 2:29pm UTC](https://community.wowza.com/t/httpprovider-and-basic-http-authentication/39852/4 "2013-01-28T14:29:11Z")

</div>

It will be fixed in 3.5.1 patch 1. That will be next patch but I don’t have an exact time frame.

Thanks again,

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [January 29, 2013, 2:47pm UTC](https://community.wowza.com/t/httpprovider-and-basic-http-authentication/39852/5 "2013-01-29T14:47:58Z")

</div>

Actually this will be included in the 3.5.1 installer or the patch that upgrades to 3.5.1. These should be coming soon.

Richard

---

<div class="post-metadata">

**Author:** ![Kor\_Ceritor](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@Kor\_Ceritor](https://community.wowza.com/u/Kor_Ceritor)\
**Post date:** [January 28, 2013, 9:03am UTC](https://community.wowza.com/t/httpprovider-and-basic-http-authentication/39852/6 "2013-01-28T09:03:46Z")

</div>

You can see from the stack trace that I already did what you have suggested me.

com.wowza.wms.authentication. **AuthenticateBasic**.authenticateHTTPProvider

---

<div class="post-metadata">

**Author:** ![Kor\_Ceritor](https://avatars.discourse-cdn.com/v4/letter/k/97f17d/32.png) [@Kor\_Ceritor](https://community.wowza.com/u/Kor_Ceritor)\
**Post date:** [January 29, 2013, 11:11am UTC](https://community.wowza.com/t/httpprovider-and-basic-http-authentication/39852/7 "2013-01-29T11:11:04Z")

</div>

Thanks for clarifying this!
