Header authentication in webhook

Hi i have a problem with authentication of the Webhook node. Tests of the workflow without authentication work fine. When i enable HTTP header auth and i set the request header in the format <name>:<token> the webhook passes authentication in test mode but then errors immediately with the message Problem in node webhook in the UI. The http header creds are created with overwrite credentials in the format {"httpHeaderAuth":{"name":"api","value":"token"}}. When i set the webhook node to respond from last node using production url, the returned message is “Error in workflow”, but the logs don’t yield anything useful.If the credentials are set incorrectly the webhook responds with a Authorization data is wrong! message as expected.

To summarize, the workflow works without auth, but when the webhook header auth is enabled, authentication seems to pass but the node/workflow errors without a helpful error message. It appears that execution is aborted because nothing appears in the executions list.

Hi @Hash, I am sorry to hear you are having trouble.

I just gave the below workflow a quick go on the current n8n version 0.201.0:

My credentials are configured like this:

image

The below request to the rest URL was working fine for me:

curl --request GET --url https://mutedjam.app.n8n.cloud/webhook-test/43515fe6-9fd4-4f97-8306-f923a5c6dab9 --header 'x-foo: bar'

Same for a production request after activating the workflow and saving successful executions:

curl --request GET --url https://mutedjam.app.n8n.cloud/webhook/43515fe6-9fd4-4f97-8306-f923a5c6dab9 --header 'x-foo: bar'

Sending a request with the wrong authentication data results in a 403 response as expected:

Could you perhaps share your workflow, confirm the n8n version you are currently using and the exact request you are making?

1 Like

Ok so i was unable to use the credentials in my existing workflow for some reason, but when i created a fresh workflow with the same node setup including auth it works fine, so i guess problem resovled for now. thanks

1 Like

Glad to hear this is now working for you, thanks so much for confirming!

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