ich verzweifel derzeit mit der HTTP Api der Dahua IP Cam. Ich kann beim Baustein "Benutzerdefinierte Intercom" z.B. diesen String eintragen und es funktioniert auch Problemlos. (User und Passwort sind natürlich im Baustein hinterlegt) -> Intercom; http://192.168.0.127:80/cgi-bin/snapshot.cgi?channel=0
So jetzt zum Problem: Ich möchte mir einen Taster anlegen mit dem ich die CAM manuell rebooten kann. Dafür ein Virtuelle Ausgang angelegt inkl. Befehl -> http://admin:admin123@192.168.0.127/...?action=reboot. Im Miniserver sehe ich immer 401 Unauthorized (siehe Screenshot)
Wenn ich es über den Browser aufrufe, funktioniert es auch also User & Passwort stimmen! Jetzt hab ich nur noch das in der Doku gefunden. Da steige ich aber vom Wissenstand leider aus was das genau bedeutet und wie und ob man es beheben kann.
The Dahua video product supplies two authentication ways: basic authentication and digest authentication. If the http request does not
have “Authorization” , the Dahua video product returns 401, utill the http request has a legal authentication .
For example:
1. When basic authentication, the Dahua video product response:
401 Unauthorized
WWW-Authenticate: Basic realm=”XXXXXX”
Then the client encode the username and password with base64, send the following request:
Authorization: Basic VXZVXZ.
2. When digest authentication, the Dahua video product response:
WWW-Authenticate: Digest realm="DH_00408CA5EA04", nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef9 5ad",
stale=FALSE, qop="auth";
The client calculates the digest using username, password, nonce, realm and URI with MD5, then send the following request:
Authorization: Digest username="admin", realm="DH_00408CA5EA04", nc=00000001,cnonce="0a4f113b",qop="auth"
nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef9 5ad",uri="cgi-bin/global.login?userName=admin",
response="65002de02df697e946b750590b44f8bf"
Bin für jede Hilfe dankbar!
Marco
Kommentar