DigestAuth not working with IP cameras

Describe the problem/error/question

Im trying to retrieve a screencap of an IP camera using the cgi feature of it. I get an 401 error. I have tried to do the same process on Postman or MacOS terminal and it does wotk

Using cURL:

andresmorago@Andress-MacBook-Pro ~ % curl --digest -u 'user:pass@' \
  'http://172.30.164.210/cgi-bin/snapshot.cgi?channel=1' \
  -o /tmp/snapshot.jpg -v
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 172.30.164.210:80...
* Connected to 172.30.164.210 (172.30.164.210) port 80
* Server auth using Digest with user 'user'
> GET /cgi-bin/snapshot.cgi?channel=1 HTTP/1.1
> Host: 172.30.164.210
> User-Agent: curl/8.7.1
> Accept: */*
> 
* Request completely sent off
< HTTP/1.1 401 Unauthorized
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0< Connection: close
< Content-Length: 0
< WWW-Authenticate: Digest realm="Login to 06006AXXXXC5275B", qop="auth", nonce="058c927e-09ea-4548-9bbc-f2a6b7bcfbbd", opaque=""
< 
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection
* Issue another request to this URL: 'http://172.30.164.210/cgi-bin/snapshot.cgi?channel=1'
* Hostname 172.30.164.210 was found in DNS cache
*   Trying 172.30.164.210:80...
* Connected to 172.30.164.210 (172.30.164.210) port 80
* Server auth using Digest with user 'user'
> GET /cgi-bin/snapshot.cgi?channel=1 HTTP/1.1
> Host: 172.30.164.210
> Authorization: Digest username="user", realm="Login to 06006AXXXXC5275B", nonce="058c927e-09ea-4548-9bbc-f2a6b7bcfbbd", uri="/cgi-bin/snapshot.cgi?channel=1", cnonce="M2RjMjdiMWUxMjXXXXXXNjQ5NmNmMTFkNzhmMDE2ZDY=", nc=00000001, qop=auth, response="0697f06XXXXXX3f541eae99594f14dcc", opaque=""
> User-Agent: curl/8.7.1
> Accept: */*
> 
* Request completely sent off
< HTTP/1.1 200 OK
< Connection: close
< Content-Length: 142752
< Content-Type: image/jpeg
< 
{ [2920 bytes data]
100  139k  100  139k    0     0   458k      0 --:--:-- --:--:-- --:--:--  458k
* Closing connection

What is the error message (if any)?

Authorization failed - please check your credentials
Error Invalid Authority!
{ "headers": { "accept": "application/json,text/html,application/xhtml+xml,application/xml,text/*;q=0.9, image/*;q=0.8, */*;q=0.7", "authorization": "**hidden**" }, "method": "GET", "uri": "http://172.30.164.210/cgi-bin/snapshot.cgi", "gzip": true, "rejectUnauthorized": true, "followRedirect": true, "resolveWithFullResponse": true, "followAllRedirects": true, "timeout": 300000, "encoding": null, "json": false, "useStream": true, "auth": { "user": "user", "pass": "**hidden**", "sendImmediately": false } }

Please share your workflow

Share the output returned by the last node

Item Index
0
Node type
n8n-nodes-base.httpRequest
Node version
4.2 (Latest)
n8n version
1.113.3 (Self Hosted)
Time
10/3/2025, 12:06:19 PM
Stack trace
NodeApiError: Authorization failed - please check your credentials at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base_@[email protected]_asn1.js@5_afd197edb2c1f848eae21a96a97fab23/node_modules/n8n-nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts:847:16) at processTicksAndRejections (node:internal/process/task_queues:105:5) at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1265:8) at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1446:11) at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1847:27 at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2461:11

Information on your n8n setup

  • n8n version: 1.113.3
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Debian 12

well it kind of failed too :slight_smile:

I guess this is because of the digest.

It’s hard to troubleshoot without being able to access. If this is something I could access, I could try to figure it out.

It fails the first time during full execution because of how digest works. as it has to get the nonce value

I think I could be onto something here. Just tried creating a basic service with Digest Auth and it fails just like yours. Was only able to get the file through the code node, which is obviously undesirable. I would report this as bug.

If you don’t want to report this, let me know I will do it for you.

1 Like

Thanks! Please do so as I believe this need to be fixed

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.