Authentication Examples?

Discussion for all types of camera
oppyoppy
Posts: 2
Joined: Wed Feb 21, 2018 8:35 pm

Authentication Examples?

Postby oppyoppy » Wed Feb 21, 2018 8:53 pm

Hello All,

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"

jantman
Posts: 13
Joined: Thu May 03, 2018 12:36 pm
Location: Atlanta, GA
Contact:

Re: Authentication Examples?

Postby jantman » Thu May 03, 2018 1:25 pm

What more examples are you looking for than the quote above?

With the asterisk that Basic is apparently no longer supported on newer firmware versions, only digest.
Lead Software Engineer, Tooling & Automation. Formerly, Wireless & Network Systems Engineer.
Doing all sorts of crazy things to anything with an IP address.
http://www.jasonantman.com / http://github.com/jantman


Return to “Technical Discussion”

Who is online

Users browsing this forum: Google [Bot] and 7 guests