When I try to set a password for basic auth I can’t get it to work. If I set it to “password” that’s fine. But anything other than that simple word fails. Are there rules to what the password can be?
@technovangelist welcome to the community.
I guess it works with password cuz it’s the default value. Did you check link below? How are you running n8n?
I did see the docs. If I change it to something else then password no longer works but what I set it to doesn’t work either
Is what you set the password to going to be the password? Or is that a base64 representation of it or something else? Are there restrictions on size, characters used? Could it point to a directory not being writeablenor anything like that?
Sadly I do not know those details for sure. When @jan is available, he will answer.
I certainly cannot remember good long passwords, so i use 1password. But there seemed to be a problem with the way 1password does the copy and paste. This is the only tool i have that uses basic auth so never encountered it before. I added the 1passwordX chrome extension vs the regular 1password extension and it copies the password correctly.
Correct, what you set is the actual password (no base64 encoding or anything). I just tested it, it works totally fine for me also via a .env file.
The file would then look like this:
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=user
N8N_BASIC_AUTH_PASSWORD="a@s!d:f"
Make sure to use quotes around the password if you want to use special characters, else bash will not set the environment variable correctly and the password will not work (as it sets the password also to that wrong value).
I too have trouble accessing the backend when setting a password. Auth always fails. When I remove the auth parameters, everything works fine.
My n8n.ini for supervisor:
[program:n8n]
environment=N8N_HOST=mydomain.com,VUE_APP_URL_BASE_API="https://mydomain.com/",WEBHOOK_TUNNEL_URL="https://mydomain.com/",GENERIC_TIMEZONE="Europe/Berlin",N8N_BASIC_AUTH_ACTIVE=true,N8N_BASIC_AUTH_USER=user863,N8N_BASIC_AUTH_PASSWORD=mylongpassword
command=n8n
startsecs=60
autostart=yes
autorestart=yes
I tried putting the password in quotes which didn’t help.
Am I doing something wrong?
n8n@0.154.0
Hi @pkastner, your environment variables look good to me - do you by any chance use special characters in your password which supervisor expects you to escape or encode somehow? Would it work with a simple text only password?
@MutedJam No special characters in my password, made sure of that. I tried text-and-numbers-only and letters-only passwords with and without quotes, none of them worked, unfortunately.
FYI this link is now 404.
Ah, that link has now moved to here: Configuration | Docs
The envrionment variables also got their own section by now:
That sounds odd. It might be something specific to supervisor, so could be worth reaching out to their team or community.
I’ve quickly tested setting N8N_BASIC_AUTH_ACTIVE, N8N_BASIC_AUTH_USER and N8N_BASIC_AUTH_PASSWORD on my end in version 0.154.0 and am getting the basic auth prompt as expected.
I’ll also see if I can find some time to play with supervisor later in order to further investigate here.
My apologies. It turns out I forgot supervisorctl update in the whole chain of commands when changing supervisord environment variables which is needed to ‘apply’ the change.
For later reference, should someone else run into this, you might wanna do:
supervisorctl reread && supervisorctl update && supervisorctl status
Awesome and no worries at all - I am glad this worked out in the end ![]()