HTTP digest authentication

The HTTPGet(), HTTPPost(), and HTTPPut() instructions support HTTP digest authentication. This includes the table streaming options of HTTPPut() and HTTPPost(). Use digest authentication when you communicate with devices that require it, such as some IP cameras. You can also use it with any HTTP server that supports and enables digest authentication.

Requirements

Digest authentication requires one of the following operating systems or later:

  • CR1000X: 9.0.0

  • CR6: 15.0.0

  • GRANITE 9: 4.0.0

  • GRANITE 10: 4.0.0

Enabling digest authentication

To enable digest authentication add [digest] to the beginning of the string passed in the URI parameter. This string is case sensitive. Include the user name and password before the host part of the URL. For example:

"[digest]http://<username>:<password>@example.com/path"

NOTE: State for digest authentication is not preserved between calls to the instruction. Each time the instruction is called, it starts fresh and performs authentication again—even if the server-issued one-time token (called a nonce) from the previous call would still be acceptable. However, if a single call triggers multiple HTTP requests (for example, while streaming a table or following redirects), all of those requests within that one call will reuse the same nonce.

Digest and basic authentication

When the URI string starts with [digest], the data logger uses only digest authentication. It does not try basic authentication.

When the URI string does not start with [digest], the data logger uses basic authentication. To use basic authentication, include <username>:<password>@ before the host part of the URL.

Supported standards

Digest authentication follows RFC 2617. The data logger supports legacy digest authentication and qop=auth with algorithm=MD5. RFC 7616, which adds algorithms such as SHA-256, is not supported.