Digest Authentication

Hi,

I want to write some lua code that does the same thing as this curl command:

curl -X GET https://www.web-site.net/aaa/bbb -u username:password -k --digest

Notice the --digest switch at the end. This is what is causing me headaches I think.

I have gotten this far:

[code]local socket = require(“socket”)
local https = require(“ssl.https”)
local ltn12 = require(“ltn12”)

https.TIMEOUT = 5
https.PORT=443

local body, code, headers, status = https.request{
url = “https://username:password@www.web-site.net/aaa/bbb”}
}
[/code]

Status reports “HTTP/1.1 401 Unauthorized” so I conclude that the username/password is not being passed correctly. I suspect this is because the site requires Digest Authentication.

I’ve not found any examples for Digest Authentication code with Lua. Given that the curl command works fine the Vera3 supports Digest authentication, but how is this done in lua code, as I’d prefer not calling curl?

Jasper,

Did you ever figure out how to do Digest Auth with Lua? I need to figure the same thing out myself.

Thanks for sharing any info on this.

Stevex64

Maybe this will help…

http://forum.micasaverde.com/index.php/topic,29897.msg212423.html#msg212423

[quote=“stevex64, post:2, topic:183480”]Jasper,

Did you ever figure out how to do Digest Auth with Lua? I need to figure the same thing out myself.

Thanks for sharing any info on this.

Stevex64[/quote]

No, I never got it to work. I ended up building a solution using Windows Azure. I’m much more comfortable in programming .NET.

As the moment I’m looking into using Home Genie: http://www.homegenie.it/ . I’m still using Vera but I’m getting more and more tired of the instability issues and poor performance. It is however much too early to say if HomeGenie is any better. My main take away is that Home Automation is still in its infancy/bleeding edge.