Not able to login to either Docker or npm version of n8n via local network

I install the latest n8n in both npm and Docker. New install. Both I am seeing this issue where I can setup my admin account using http://localhost:5678/ but when I try to access it from another computer using example http://192.168.0.9:5678 I get a 401 error when trying to login:

inspector.js:7 GET http://192.168.0.9:5678/rest/users 401 (Unauthorized)

inspector.js:7 GET http://192.168.0.9:5678/rest/workflows 401 (Unauthorized)

inspector.js:7 GET http://192.168.0.9:5678/rest/active-workflows 401 (Unauthorized)

inspector.js:7 GET // 401 (Unauthorized)

ResourcesListLayout.vue:434 Uncaught (in promise)

  1. m {message: ‘Request failed with status code 401’, name: ‘AxiosError’, code: ‘ERR_BAD_REQUEST’, config: {…}, request: XMLHttpRequest, …}

inspector.js:7 GET // 401 (Unauthorized)

becomeTemplateCreatorStore.ts:55 Uncaught (in promise)

  1. m {message: ‘Request failed with status code 401’, name: ‘AxiosError’, code: ‘ERR_BAD_REQUEST’, config: {…}, request: XMLHttpRequest, …}

I already attempted to change localhost and listening to 192.168.0.9 and still getting an error.
I can use n8n normally on both either npm or Docker as localhost. setup a workflow … etc…

  • **n8n version: 1.13.1
  • **Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own,main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Windows 10

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

I reverted back to n8n version 1.29.1 and now able to access n8n via network.

2 Likes

hello @Fernando_Martinez

The issue is that the authentication mechanism prevents using non-secure channels like HTTP. The authentication cookie is not setting and thus you are not able to authenticate.

@Jon can you take a look into it?

Looks like a recent security update has changed this, I am surprised we have not seen this internally when testing locally although we typically connect to localhost which would be ok.

1 Like

So as a temporary solution if you are not using https at all you can set the N8N_SECURE_COOKIE env option to false and this should get you back up and running.

2 Likes

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

New version [email protected] got released which includes the GitHub PR 8906.

1 Like