I just started using n8n through docker-compose, and i can’t turning on basic auth.
i try to check environment variables, and they exists in container.
Here they are, just as in server installation docs:
Your previous excerpt from the container environment (and the now removed screenshot) showed that a change of the in .env file changed the N8N_BASIC_AUTH_USER and N8N_BASIC_AUTH_PASSWORD parameters in the container.
If you were now able to not change them in the container, the exact steps you did to create the new situation (in difference to the previous state) would be helpful for me to know about to better understand how you’re controlling the environment parameters on your end.
Are you sure? This configuration effectively only sets N8N_BASIC_AUTH_ACTIVE to true. The parameters N8N_BASIC_AUTH_USER and N8N_BASIC_AUTH_PASSWORD are not guaranteed to be set based on what I know about configuring the environment parameters with docker-compose, therefore the group of three required parameters (as outlined in the documentation) can remain incomplete and may render void.
What is your rationale that “it must be started with basic auth”, as you’ve just written that the username is not set? I personally would not expect basic auth to work unless all_required parameters of the group are set and have valid values.
What happens if you set the N8N_BASIC_AUTH_USER and N8N_BASIC_AUTH_PASSWORD parameters directly in the docker-compose.yml, like:
This is similar to what I’ve asked earlier if you can run two tests: the first to change your .env configuration to the username “test” and password to “test”; the second to verify with the two other given values. Were you able to perform these tests and which results could you gather? If you didn’t perform these tests, it would be kind of you to let me know what prevented you to perform these tests.
And I’ve another follow up question regarding the software stack you have configured:
Which docker version are you running on the remote machine?
It looks like that the values are getting filtered.
I guess you still have the same situation, that the auth dialog does not show? In any case, try with a different browser not that some auth credentials are already set. See as well the documentation of your browser how you can invalidate an authentication session.
Can you try to reproduce on your local machine? Just with that docker-compose?
I install same versions of docker and n8n on my local machine, and nothing changes with empty field, or with filled with test-credentials.
I try to use incognito-mode or different browser, and problem is still the same.