Hello!
I’m trying to configure JWT instead of basic auth for n8n ui-editor. I’ve configured Auth0 and have JWT token and JWKS.
My n8n instance is running with ENV variables related to JWT:
N8N_JWT_AUTH_ACTIVE=true
N8N_JWT_AUTH_HEADER=Authorization
N8N_JWT_AUTH_HEADER_VALUE_PREFIX=Bearer
N8N_JWKS_URI=https://n8n.eu.auth0.com/.well-known/jwks.json
but I get error on browser when trying to open editor: {“code”:403,“message”:“ Invalid token”}.
I’ve inspected http request at Chrome dev tools and see that request headers doesn’t have any Authorization header.
I tried to specify bearer token at N8N_JWT_AUTH_HEADER but got the error Missing token
I was repeated the same request at Postman with auth header Authorization: Bearer <MY_TOKEN> and got loaded n8n without any errors, so for some reason n8n client can’t send Authorization header.
What should I do to JWT header be sent at request headers?
Thanks in advance!
Hey @bilravil!
Welcome to the community 
Can you share the steps that I can follow to re-create this? If you’re able to access it via Postman, it should work on the browser as well.
Hi @harshil1712!
I have access via Postman because I just repeated http request to my instance like from browser but manually have added Authorization header Authorization: Bearer <JWT_TOKEN>.
Steps to recreate:
-
Have n8n instance with enabled JWT auth like me:
N8N_JWT_AUTH_ACTIVE=true N8N_JWT_AUTH_HEADER=Authorization N8N_JWT_AUTH_HEADER_VALUE_PREFIX=Bearer N8N_JWKS_URI=<JWKS_URI>
-
At Postman send GET request to your instance without any headers → receive error Missing token. At browser I see the same error.
-
Add header Authorization: Bearer <JWT_TOKEN> and repeat the request → see loaded html in response window.
So my conclusion is n8n ui editor can’t set Authorization header.
is there any comprehensive info about how to configure n8n to use JWT tokens (instead of basic auth for example)?
is it possible to only protect the admin ui, but to use other auth mechanisms for webhooks?
Good question. I have the same question and have scoured the internet trying to find an answer.
Hi @bilravil. Did you find any success while accessing through JWT? If yes, can you share the solution? It would be soo helpful because I have same query. Thanks
Hi all, I never got this to fully work either tbh. I suspect it might simply have been a mechanism used by n8n cloud behind the scenes, but never saw this fully documented anywhere beyond the stub here. Perhaps @kik00 knows more on this one? I am not even sure this would support user management (as the basic auth mentioned on the same page wouldn’t).
The good news is, however, that SSO is something our product team is looking into (I think internally it’s usually referred to as “bring your own auth”). So, things might change and improve in the future.