JWT auth in webhook

Describe the problem/error/question

My webhook works perfectly fine without JWT auth, but as soon as I enable it, it does not get the trigger.

With no Auth, the workflow triggers, and I can see the appropriate
“authorization”: “Bearer XXXX” in the input

When enabling Auth, the workflow does not trigger and I receive a “N8N API error: invalid signature” in my front

I have doubled-triple-quadruple checked the passphrase (I am using JWT passphrase HS256).

What is the error message (if any)?

none

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.81.4
  • Database (default: SQLite): /
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system:

Have you tried using the option Header Auth instead? Since you are using Bearer instead of JWT.

Hi Octionic,
Thanks for the reply; indeed the Header Auth seems to work, but it is not fully secure (unless I am mistaken: the header will be visible through my frontend)
Have you managed to make this node work through JWT ?
Thanks

Actually you are right. Sorry for the confusion. Both get transported in kinda the same way.
I built a quick example here to test the functionality and it just worked fine. So maybe the issue is located in your frontend application.

Maybe you try it with this and then compare it with your frontend.
So in order to get this example to work you

  • run the JWT node to generate a token after settig a passphrase in it’s credential
  • use that to set the credential in the HTTP Node (Name: Authorization, Value: Bearer )
  • use the same JWT Auth credential in the webhook node as well
  • copy the production URL of the webhook and paste it in the URL of the HTTP request node and run it

Thank you, indeed my front was poorly configured - seems to work now !

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