Steps
Read the status and message: they tell you which check failed
We sent 28 requests to a published Webhook node (v2) on n8n 2.43.7. Each auth type answers with its own message. Basic Auth: 401
Authorization is required!when no credentials arrive, 401Authentication data is wrong!for a wrong user or password. Header Auth: always 403Authorization data is wrong!, also when the header is missing. JWT Auth: 401No token provided, or 403jwt expired,invalid signatureorjwt malformed. A 500No authentication data defined on node!means the node has an auth type but no credential selected: open the node, pick or create the credential, and publish again.Header Auth: send the exact value, in a header
Header Auth compares one header with one exact value. The header name is case-insensitive (
x-api-keyworked forX-API-Key), but the value is not: with the credential valueBearer tok-9, bothtok-9andbearer tok-9got 403. A value wrapped in quotes also failed; a trailing space was fine because HTTP strips it. If you storeBearer xyzin the credential, the caller must send exactlyAuthorization: Bearer xyz; if you store onlyxyz, the caller must send only that.API key in the URL? Header Auth ignores the query string
Sending the key as
?X-API-Key=k-123got 403: Header Auth reads headers only. If the calling service can only put a key in the URL, set Authentication to None and check it yourself: an IF node on{{ $json.query.key }}, then a Respond to Webhook node returning 401 on the false branch (we did not run this setup). Use a long random key, since URLs end up in logs.Basic Auth: the caller must send Basic, not Bearer
Basic Auth worked with
curl -u user:password, with credentials in the URL (https://user:pass@host/webhook/..., which curl turns into the header) and even with a lowercasebasicscheme. SendingAuthorization: Bearer <password>got 401Authorization is required!, as if nothing was sent. Wrong user and wrong password give the same message, so check both.JWT Auth: add the Bearer prefix, watch exp
The JWT credential (HS256 passphrase in our tests) expects
Authorization: Bearer <token>. The bare token withoutBearergot 401No token provided, the same as no header at all. An expired token gave 403jwt expired; a token signed with another secret gaveinvalid signature, so check the passphrase matches the signer exactly. A token with noexpclaim was accepted and never expires: give your tokens an expiry. On success the claims are in$json.jwtPayload. Signing tokens in n8n: n8n JWT node not working.Browser shows a username and password popup
Every auth failure, including Header and JWT, came back with
WWW-Authenticate: Basic realm="Webhook". Opening a Header or JWT protected webhook in a browser therefore shows a login popup that can never succeed. That is expected: test protected webhooks with curl or the calling service, not the address bar.Still 404? Auth is checked after the URL
A call to the test URL
/webhook-test/...while the editor was not listening got 404 before any auth check. Fix the URL first (published workflow, production/webhook/path, right method): see n8n webhook not working (404).
What we ran
On 25 October 2026 we sent 28 curl requests to self-hosted n8n 2.43.7 (n8n start), Webhook node v2 on production URLs, workflows published via the CLI. Credentials: Basic Auth (alice / s3cret), Header Auth (X-API-Key = k-123, and Authorization = Bearer tok-9) and JWT Auth with an HS256 passphrase. We recorded the exact status and body of each reply.
| Request | What n8n answered |
|---|---|
Basic Auth, correct curl -u alice:s3cret | 200, workflow runs |
| Basic Auth, no Authorization header | 401 Authorization is required! + WWW-Authenticate: Basic realm="Webhook" |
| Basic Auth, wrong password | 401 Authentication data is wrong! |
| Basic Auth, wrong user name | 401 Authentication data is wrong! (same message as a wrong password) |
Basic Auth, credentials in the URL https://alice:s3cret@host/... | 200 (curl turns them into the header) |
Basic Auth, scheme written lowercase basic | 200 |
Basic Auth, Authorization: Bearer s3cret sent instead | 401 Authorization is required! |
Header Auth X-API-Key: k-123, correct | 200 |
Header Auth, header name in lowercase x-api-key | 200 (header names are case-insensitive) |
| Header Auth, header missing | 403 Authorization data is wrong! (403, not 401, even when missing) |
| Header Auth, wrong value | 403 Authorization data is wrong! |
Header Auth, key sent as query parameter ?X-API-Key=k-123 | 403 (the query string is not checked) |
| Header Auth, trailing space after the value | 200 (HTTP strips trailing whitespace) |
| Header Auth, value wrapped in quotes | 403 |
Header Auth name Authorization, value Bearer tok-9, sent exactly | 200 |
Same credential, sent as Authorization: tok-9 (no Bearer) | 403 |
Same credential, sent as Authorization: bearer tok-9 | 403 (exact, case-sensitive value match) |
JWT Auth (HS256 passphrase), valid Bearer token | 200, claims in $json.jwtPayload |
| JWT Auth, no Authorization header | 401 No token provided |
| JWT Auth, expired token | 403 jwt expired |
| JWT Auth, token signed with another secret | 403 invalid signature |
JWT Auth, token sent without the Bearer prefix | 401 No token provided |
JWT Auth, token with no exp claim | 200 (accepted, never expires) |
| JWT Auth, garbage token | 403 jwt malformed |
| Basic, Header or JWT chosen but no credential selected (3 runs) | 500 No authentication data defined on node! |
Test URL /webhook-test/... while the editor is not listening | 404 not registered, auth is never reached |
Your secret is saved in every execution
After a successful call, the secret was still in the item: $json.headers.authorization (the Basic base64 or the Bearer JWT) and $json.headers["x-api-key"]. It is stored in the execution history and passed to every later node. Remove headers with an Edit Fields node right after the Webhook, or do not save successful executions for that workflow.
Checklist
- A credential is selected in the node (else 500
No authentication data defined on node!). - Workflow published again after changing auth.
- Header Auth: header, not query; value byte for byte, case included.
- Basic Auth: caller sends
Basic, notBearer. - JWT:
Bearerprefix, same passphrase as the signer, anexpclaim. - Test with curl, not a browser.
- Strip
headersbefore saving or forwarding data. - Protecting a public n8n chat? 401 vs 403 and why Allowed Origins is not access control: n8n Chat Trigger not working.
Receiving files on the protected webhook? See n8n Webhook file upload and binary data.
Good to know
- Calling the n8n API itself and getting 401 or 403? See n8n API key 401 Unauthorized fixes.
What we did not test
JWT with PEM keys or RS256, the JWT required-claims options, the IF plus Respond to Webhook pattern for query keys, the editor UI and n8n Cloud.
Start from a working agent
FAQ
Why does my n8n webhook return 403 Authorization data is wrong?
Header Auth answers 403 for a missing header, a wrong value, a value with different case, a key sent in the query string, or a value in quotes. Send the exact credential value in the configured header.
Why does my n8n webhook return 401 Authorization is required?
Basic Auth got no Basic credentials. A Bearer header counts as nothing. Send curl -u user:password or an Authorization: Basic header.
Why does n8n JWT webhook auth say No token provided?
The Authorization header is missing or lacks the "Bearer " prefix. Send Authorization: Bearer followed by the token.
What does No authentication data defined on node mean in n8n?
The Webhook node has Basic, Header or JWT auth selected but no credential chosen. It returns 500 until you select one and publish.
Can n8n Webhook Header Auth read an API key from the URL?
No. In our tests ?X-API-Key= got 403. Check query keys yourself with an IF node and Respond to Webhook.
Why does my browser ask for a password on an n8n webhook?
Every auth failure, even for Header and JWT auth, sends WWW-Authenticate: Basic. Test with curl instead.
Related guides
- n8n JWT node not working: missing exp, Bearer, invalid algorithm, 54 runs
- n8n API 401 Unauthorized or 403 Forbidden: API key fixes, tested
- n8n Google Sheets node not working: Bad request, invalid_grant, private key fixes
- n8n Redis node errors and hangs: connection, TLS and Set fixes, 50 tests
- n8n webhook not working? Test URL vs production URL and every 404 explained
New guides
- GitHub release notifications in Slack (any public repo, stable releases only)
- Send RSS feeds to Slack with a keyword filter (free, incoming webhook)
- Forward emails to a Slack channel (Gmail, Outlook, any IMAP), free with an incoming webhook
- n8n Google Sheets Trigger not working: not firing, activation errors and fixes