3.5 Authentication
Video products support either basic authentication or digest authentication, see RFC 2617 for
detail. If the http request sent by client does not provide valid "Authorization" header information,
video products would return HTTP status code 401 and some information for authentication,
then client should calculate authentication information according RFC 2617, and sent request
again with authentication information using “Authorization” header. Video products return the
required resource only if authorization information correct.
For example:
1. When basic authentication fails, response is:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm="XXXXXX"
The client encodes the username and password with base64, and then sends it to server. A valid Authorization like this:
Authorization: Basic VXZVXZ
2. When digest authentication fails, response is:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="DH_00408CA5EA04",
nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad", stale=FALSE, qop="auth"
The client calculates the digest authorization using information like username, password, nonce, HTTP method and URI with MD5, and then sends it to server.
For example:
Authorization: Digest username="admin", realm="DH_00408CA5EA04", nc=00000001, cnonce="0a4f113b",
qop="auth", nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad",
uri="/cgi-bin/magicBox.cgi?action=getLanguageCaps", response="65002de02df697e946b750590b44f8bf"