# (adminAuth) unable to login node-red

**URL:** https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074
**Category:** General
**Created:** [21 January 2019 03:49 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074 "2019-01-21T03:49:32Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)
#### Post date: [21 January 2019 03:49 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/1 "2019-01-21T03:49:32Z")

</div>

my problem is unable to login in node-red.the node-red is normal running if remove the adminAuth in setting.js files.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b7073dc59ad83bb3bd99a66ce916e8f25226aa84.png)  
But if I set adminAuth in setting.js file with username/password:admin/admin  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/6b4ab8437e5aa7d9576debf4c08ea8c627782c83.png)  
then I restart the node-red. the node-red is normal starting.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/3/3b750aead4272135080ecacb166131ef5029d529.png)  
But i can't login in the node-red editor  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/6/6a260f2628a7f67f10e58462e18d593a1293089d.png)

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [21 January 2019 07:33 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/2 "2019-01-21T07:33:29Z")

</div>

Have you purposely not removed the // from the start of the sessionexpiry line?

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [21 January 2019 07:36 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/3 "2019-01-21T07:36:17Z")

</div>

That's an optional field so won't have an bearing here.

---

<div class="post-metadata">

### Author: ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)
#### Post date: [21 January 2019 07:49 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/4 "2019-01-21T07:49:12Z")

</div>

if i don't remove the "//", the node-red login web will be missing, and can editor the flow directly. The Node-red flows work normally.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a7a272690d409a798e8c7c0d7400df9828a97aad.png)  
Now i want to use adminAuth. i have already test adminAuth settting successfully in CPU:ARMv7 Processor rev 5 (v7l) platform, But i test adminAuth setting failed in CPU:MIPS 1004Kc V2.15.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/f5aa3c9556d3a34504ec71e6851d397e4421a726.png)  
I don't know how to find the Error for this problem?

---

<div class="post-metadata">

### Author: ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)
#### Post date: [21 January 2019 07:56 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/5 "2019-01-21T07:56:10Z")

</div>

could you give me some advices for how to find the error and solve it.

---

<div class="post-metadata">

### Author: ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)
#### Post date: [29 January 2019 08:13 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/6 "2019-01-29T08:13:50Z")

</div>

could you give me some any reply?

---

<div class="post-metadata">

### Author: ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)
#### Post date: [29 January 2019 08:14 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/7 "2019-01-29T08:14:35Z")

</div>

Do you have any good idea for this problem? thanks very much!

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [29 January 2019 08:24 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/8 "2019-01-29T08:24:44Z")

</div>

It is hard to tell from the screenshots exactly what error you hit.

Is it:

1. you cannot enter a password in the dialog (known issue: [https://github.com/node-red/node-red/issues/1982](https://github.com/node-red/node-red/issues/1982))
2. you can enter a password and click login but the request hangs (you last screenshot looks like that)
3. you can enter a password and click login, but it returns a 'login failed' type message?

Have you looked at the JavaScript console for any errors?

---

<div class="post-metadata">

### Author: ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)
#### Post date: [29 January 2019 08:55 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/9 "2019-01-29T08:55:06Z")

</div>

i can enter a password and click login but after i click login the web request hangs continuous about 40 seconds,then it returns a 'login failed' type message. i have also use a error username or error password to test , there are same phenomenon.About the JavaScript console without any errors printing.  
This is the Caught file.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/97d3fa18efc7c607bafdcb924eba8482ae5956b1.png)

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [29 January 2019 08:58 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/10 "2019-01-29T08:58:33Z")

</div>

Can you edit your settings.js file and set the `logging.audit` value to `true` and the `logging.level` to `"trace"`. Then restart Node-RED and try again. Then see what the Node-RED log shows.

It is odd for it to take 40 seconds to respond - I'm not sure what could cause that. What type of machine is this running on?

---

<div class="post-metadata">

### Author: ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)
#### Post date: [29 January 2019 09:26 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/11 "2019-01-29T09:26:43Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/fe5dc57afb3746e345e5a67fb3e707d7943ef1f9.png)

---

<div class="post-metadata">

### Author: ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)
#### Post date: [29 January 2019 09:30 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/12 "2019-01-29T09:30:02Z")

</div>

I think that the username and password did not work .

---

<div class="post-metadata">

### Author: ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)
#### Post date: [29 January 2019 09:34 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/13 "2019-01-29T09:34:36Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/25b18fcc747c65eb9715bdac5875e43d08910c8c.png)

---

<div class="post-metadata">

### Author: ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)
#### Post date: [29 January 2019 09:42 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/14 "2019-01-29T09:42:14Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/af03ffcf3691bc57257a8284f3f3253424b92c1e.png)

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [29 January 2019 09:46 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/15 "2019-01-29T09:46:55Z")

</div>

What hardware is this running on? The `uname` command says `Linux router` - so is this a low powered, low memory router type device? That could explain why it takes so long to respond - the bcrypt password hashing can be quite slow on slow devices. But it doesn't explain why the login fails.

When node-red is installed, it tries to install the `bcrypt` module to handle the password hashing. This is a binary module that doesn't always successfully install. As a fall back, we also install `bcryptjs` - a pure javascript implementation that will install cleanly, but is much slower than the binary module.

Can you try reinstalling the bcrypt module; in the directory `/mnt/sd/node-js-app/node-red-0.19.5/` run `npm install bcrypt`

---

<div class="post-metadata">

### Author: ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)
#### Post date: [29 January 2019 10:02 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/16 "2019-01-29T10:02:06Z")

</div>

Node-red run in embedded Router device(Linux operating system), i know the bcrypt module that doesn't always successfully install.i have checkout that bcrypt is install Success.

---

<div class="post-metadata">

### Author: ![gilad](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@gilad](https://discourse.nodered.org/u/gilad)
#### Post date: [1 December 2019 15:42 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/17 "2019-12-01T15:42:33Z")

</div>

Not sure if it still relevant,  
but the following method worked for me (version 1.0.3):

1. Run `npm install -g node-red-admin` or use [this tutorial](https://nodered.org/docs/user-guide/node-red-admin)
2. Generate the password hash by running `node-red-admin hash-pw`
3. Type your preferred password (case-sensitive) and write it down.
4. Edit `settings.js` file, go to `adminAuth`. section (line 123 more or less) - change the `username` property to the one you want (again, case sensitive) and the `password` property to the **generated password** from step 2.
5. Save everything, restart node-red.
6. Login with `username` and the `password` from step 3.

Hope that helps anyone.

---

<div class="post-metadata">

### Author: ![abhishekjaiswalraw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/abhishekjaiswalraw/32/16377_2.png) [@abhishekjaiswalraw](https://discourse.nodered.org/u/abhishekjaiswalraw)
#### Post date: [20 January 2020 12:19 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/18 "2020-01-20T12:19:36Z")

</div>

```auto
Error: WebSocket is not open: readyState 2 (CLOSING)
    at WebSocket.send (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:329:19)
    at completeConnection (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:103:28)
    at WebSocket.<anonymous> (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:148:21)
    at WebSocket.emit (events.js:189:13)
    at Receiver.receiverOnMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:789:20)
    at Receiver.emit (events.js:189:13)
    at Receiver.dataMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:422:14)
    at Receiver.getData (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:352:17)
    at Receiver.startLoop (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:138:22)
    at Receiver._write (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:74:10)
Error: WebSocket is not open: readyState 2 (CLOSING)
    at WebSocket.send (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:329:19)
    at completeConnection (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:103:28)
    at WebSocket.<anonymous> (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:148:21)
    at WebSocket.emit (events.js:189:13)
    at Receiver.receiverOnMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:789:20)
    at Receiver.emit (events.js:189:13)
    at Receiver.dataMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:422:14)
    at Receiver.getData (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:352:17)
    at Receiver.startLoop (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:138:22)
    at Receiver._write (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:74:10)
Error: WebSocket is not open: readyState 2 (CLOSING)
    at WebSocket.send (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:329:19)
    at completeConnection (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:103:28)
    at WebSocket.<anonymous> (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:148:21)
    at WebSocket.emit (events.js:189:13)
    at Receiver.receiverOnMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:789:20)
    at Receiver.emit (events.js:189:13)
    at Receiver.dataMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:422:14)
    at Receiver.getData (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:352:17)
    at Receiver.startLoop (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:138:22)
    at Receiver._write (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:74:10)
Error: WebSocket is not open: readyState 2 (CLOSING)
    at WebSocket.send (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:329:19)
    at completeConnection (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:103:28)
    at WebSocket.<anonymous> (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:148:21)
    at WebSocket.emit (events.js:189:13)
    at Receiver.receiverOnMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:789:20)
    at Receiver.emit (events.js:189:13)
    at Receiver.dataMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:422:14)
    at Receiver.getData (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:352:17)
    at Receiver.startLoop (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:138:22)
    at Receiver._write (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:74:10)
Error: WebSocket is not open: readyState 2 (CLOSING)
    at WebSocket.send (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:329:19)
    at completeConnection (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:103:28)
    at WebSocket.<anonymous> (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/@node-red/editor-api/lib/editor/comms.js:148:21)
    at WebSocket.emit (events.js:189:13)
    at Receiver.receiverOnMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/websocket.js:789:20)
    at Receiver.emit (events.js:189:13)
    at Receiver.dataMessage (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:422:14)
    at Receiver.getData (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:352:17)
    at Receiver.startLoop (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:138:22)
    at Receiver._write (/home/abhishek/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/ws/lib/receiver.js:74:10)

```

This issue is appearing when uncommenting the

```auto
 adminAuth: {
       type: "credentials",
       users: [{
           username: "admin",
           password: "$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN.",
           permissions: "*"
       }]
    },
ui: { path: "ui" },

```

Log In Is Not Working

 ![Screenshot from 2020-01-20 17-48-34](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/d/6ddd2720b2c09cff90e1d11e2c62f4319192610f.png)

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [20 January 2020 12:37 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/19 "2020-01-20T12:37:28Z")

</div>

Hi @abhishekjaiswalraw

as you've posted to this topic, have you followed the advice that was shared in order to try to get more logging/trace information?

You don't mention what version of Node-RED/Node.js you are using. That would be helpful to know.

---

<div class="post-metadata">

### Author: ![abhishekjaiswalraw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/abhishekjaiswalraw/32/16377_2.png) [@abhishekjaiswalraw](https://discourse.nodered.org/u/abhishekjaiswalraw)
#### Post date: [20 January 2020 13:15 UTC](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074/20 "2020-01-20T13:15:11Z")

</div>

![new3](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/0/209ee7421f5e7d0ea3ba784a3476d7a65294de55.png) ![new11](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/06b55ac1fcd13ba775a2914e856542f750defe2c.png)  
"Still not working"

```auto
// Configure the logging output
    logging: {
        // Only console logging is currently supported
        console: {
            // Level of logging to be recorded. Options are:
            // fatal - only those errors which make the application unusable should be recorded
            // error - record errors which are deemed fatal for a particular request + fatal errors
            // warn - record problems which are non fatal + errors + fatal errors
            // info - record information about the general running of the application + warn + error + fatal errors
            // debug - record information which is more verbose than info + info + warn + error + fatal errors
            // trace - record very detailed logging + debug + info + warn + error + fatal errors
            // off - turn off all logging (doesn't affect metrics or audit)
            level: "trace",
            // Whether or not to include metric events in the log output
            metrics: false,
            // Whether or not to include audit events in the log output
            audit: true
        }
    },

```

I'm using nvm

[Next page](https://discourse.nodered.org/t/adminauth-unable-to-login-node-red/7074.md?page=2)
