HTTPProvider and Basic HTTP authentication

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. :slight_smile:

Stack trace:

==> 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:

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

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

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

Richard

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

Richard

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

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

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

com.wowza.wms.authentication.AuthenticateBasic.authenticateHTTPProvider

Thanks for clarifying this!