First time poster here.
I've been reading the CGI SDK API and am confused as to why there are no examples for the authentication topic. I'm a CGI noob, but IMHO the documentation shown below is not at all clear. What should be done to login to the camera via CGI? There are examples of all other functionality, but this topic got neglected.
Thanks in advance,
Oppy
The Amcrest video product supplies two authentication ways: basic authentication and digest authentication. If the http request does not have “Authorization”, the Amcrest video product returns a 401, until the http request has a legal authentication.
For example:
1. When basic authentication, the Amcrest 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 Amcrest video product response:
WWW-Authenticate: Digest realm="DH_00408CA5EA04", nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad", 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="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad",uri="cgi-bin/global.login?userName=admin", response="65002de02df697e946b750590b44f8bf"