Hello everyone,
I would like to query the status of a LAN socket (Brennenstuhl Premium-Web-Line V3). In the browser, this can be done via the http call
http://admin:admin@192.168.4.92/cgi/relaySt?Rel=0
But in the app I get an authentivication error.
I get the same error when I try to use wget or curl in the terminal (ubuntu):
wget -v http://admin:admin@192.168.4.92/cgi/relaySt?Rel=0
With GET it works again:
GET -U -C admin:admin http://192.168.4.92/cgi/relaySt?Rel=0
After some research I believe that it is due to the request headers. I can also display this with GET:
GET -U -C admin:admin http://192.168.4.92/cgi/relaySt?Rel=0
GET http://192.168.4.92/cgi/relaySt?Rel=0
Authorization: Digest username="admin", realm="Enter User/Password", qop=auth, algorithm="MD5", uri="/cgi/relaySt?Rel=0", nonce="ae9e48b98d02cf59588ff9454c8969da", nc=00000001, cnonce="64bd3116", response="f5d9fb55a77f0dcb281760b6b91dfe6d", opaque="Opaque_Test_ddd123987fe20_finish"
User-Agent: lwp-request/6.61 libwww-perl/6.61
and
GET http://192.168.4.92/cgi/relaySt?Rel=0
User-Agent: lwp-request/6.61 libwww-perl/6.61
401 Unauthorized
Server: nbsoftware/1.1
WWW-Authenticate: Digest realm="Enter User/Password",qop="auth",nonce="e903742584e476a2245841dba71fb572",opaque="Opaque_Test_ddd123987fe20_finish",algorithm=MD5,stale=false
Content-Length: 755
Content-Type: text/html
Access-Control-Allow-Origin: *
Client-Date: Sun, 23 Jul 2023 14:04:42 GMT
Client-Peer: 192.168.4.92:80
Client-Response-Num: 1
Link: <styles.css>; rel="stylesheet"; type="text/css"
Title: Nicht autorisiert
GET http://192.168.4.92/cgi/relaySt?Rel=0
Authorization: Digest username="admin", realm="Enter User/Password", qop=auth, algorithm="MD5", uri="/cgi/relaySt?Rel=0", nonce="e903742584e476a2245841dba71fb572", nc=00000001, cnonce="64bd337a", response="5d052819c12fe1c110c000da1dffb26f", opaque="Opaque_Test_ddd123987fe20_finish"
User-Agent: lwp-request/6.61 libwww-perl/6.61
200 OK
Server: nbsoftware/1.1
Content-Length: 2
Content-Type: text/plain
Access-Control-Allow-Origin: *
Client-Date: Sun, 23 Jul 2023 14:04:42 GMT
Client-Peer: 192.168.4.92:80
Client-Response-Num: 1
Can someone help me how to get the authentication working?
THANKS!