Haiku HaikuHelper Returning 401 Error From Local App Server

yeti

Member
First off, I want to truly commend lupingblade for making a KICK BUTT application. HaikuHelper is mind-blowingly good stuff, and the API/JSON implentation is *TRULY* genius - platform independent, universally supported extendability. It is perfect for using a more robust, persistent data storage language to develop some serious business logic Seriously, bravo guys.
 
Okay quick issue. I installed ColdFusion 10 as an application server on the same machine running HaikuHelper. ColdFusion has the <cfhttp> tag which allows for simple HTTP get and posts. I entered the information in as follows but get 401 auth errors from HaikuHelper every time. Browsing the same resource via a web browser on either the machine running HH, or on another machine on the LAN, works perfectly (as long as I enter my username/password credentials as configured in the HH panel).
 
Although you may not have experience with CF, the code is pretty easy to figure out here:
 
<cfhttp port="9399"
    method="get"
    url="http://localhost/api/controller.areas"
     username="hai1-ext"
    password="1234"
    result="jsonAreas" />

 
 
I have tried putting username, password and port directly in the URL string to no avail. I have also tried putting a Safari useragent string in as well (CF passes this on as the requesting user agent so that you can mimic a user browser session). Nothing is working.
 
Again, I can browse the controller.areas page just fine from the actual machine via Safari.
 
Is there something dumb I'm missing on authentication here? Cannot figure this one out.
 
I am not familiar with CF. I suspect it might be an issue with CF using incorrect authentication type. You would have to check via a packet logger probably to trace it. PS. Is there a reason you need CF specifically? You can already create custom interfaces/applications within HaikuHelper's APIs.
 
I'll look into it at the packet level.
 
Javascript is great for basic logic stuff, yet it's not going to let me do complex business logic and data persistence. Because we are doing a HUGE install (4 OmniPro II's), Haiku as abstraction middleware that allows us to liason with hardware across all four panels is critical.
 
We are not using CF to build a webtop. We are using it's rapid development capabilities for our back end. The fact that it's also (essentially) Java also allows us a full 3GL for additional functionality should we need it. And we can install it directly on the server running HaikuHelper, which since it's a Mac limits us somewhat.
 
lupinglade said:
I am not familiar with CF. I suspect it might be an issue with CF using incorrect authentication type. You would have to check via a packet logger probably to trace it. PS. Is there a reason you need CF specifically? You can already create custom interfaces/applications within HaikuHelper's APIs.
 
UPDATE
-------------
 
After a LOT of research, we realized that Haiku is using Digest Authentication, not Basic Authentication.
 
We can begin to implement a workaround for this, and I well understand the need for encrypted authentication in certain scenarios, but in our case the application server that will be making JSON calls is installed on the Mac that is running HH. Thus there is no network traffic occurring. Might make sense in HH4 to have the option of choosing between Digest or Basic in the configuration.
 
Just to make things more helpful for anyone who is programming outside HH and needs to communicate, below is a link that provides the basis if your language doesn't support digest authentication. It is for ColdFusion but is easy enough to figure out how to port for anything.
 
http://forums.asterisk.org/viewtopic.php?f=29&t=79803
 
Hope this helps someone in the future.
 
It should be fairly easy to implement Digest. Basic is too insecure to even consider, even on a local connection.
 

Similar threads

Back
Top