Authentication Examples?

Discussion for all types of camera
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,


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"

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

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. /

Posts: 34
Joined: Fri Jul 15, 2016 7:36 am

Re: Authentication Examples?

Postby jamestx10 » Thu Nov 29, 2018 3:30 pm

I am currently using

Code: Select all

<img src=http://USER:[email protected]/cgi-bin/snapshot.cgi/ width= '1280'>

to pull an image. How do I make that same request using digest auth? Right now that code works every other time.

Posts: 2
Joined: Mon May 08, 2017 3:51 pm

Re: Authentication Examples?

Postby tholius » Fri Jan 25, 2019 2:07 pm

I have a similar question, because the http construct of user:[email protected] is deprecated.

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 16 guests