# How to add a demo user (Closed)

**URL:** <https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774>\
**Category:** General\
**Created:** [7 March 2020 19:06 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774 "2020-03-07T19:06:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebolisa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ebolisa/32/89203_2.png) [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Post date:** [7 March 2020 19:06 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/1 "2020-03-07T19:06:57Z")

</div>

Hi,

I added an admin/password user to the settings file but how do I add a demo/pass user to the ui page?  
The demo user can activate the switches but cannot enter into the editing mode.  
TIA

UPDATE: Found the solution in the setting.js file.

---

<div class="post-metadata">

**Author:** ![jan-k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jan-k/32/17738_2.png) [@jan-k](https://discourse.nodered.org/u/jan-k)\
**Post date:** [11 March 2020 09:43 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/2 "2020-03-11T09:43:48Z")

</div>

Hi ebolisa,

Did you success to set for the node red password? I had follow the forum guide and tried to set for admin and password in settings.js this afternoon. But then my node red unable to start, it display got error in settings.js file. After I uncomment them back only the node red start again. Thank you.

Best Regards.

---

<div class="post-metadata">

**Author:** ![ebolisa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ebolisa/32/89203_2.png) [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Post date:** [11 March 2020 10:53 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/3 "2020-03-11T10:53:11Z")

</div>

Actually, I'm new to this as well, I learned it over the past weekend. What helped me is this [video](https://www.youtube.com/watch?v=GeN7g4bdHiM) at minute 1:20.  
These are my changes in the settings.js file. I added a demo user as well who can see and execute the widgets but not modify them.

```auto
    // Securing Node-RED
    // -----------------
    // To password protect the Node-RED editor and admin API, the following
    // property can be used. See http://nodered.org/docs/security.html for details.
    adminAuth: {
        type: "credentials",
        users: [{
            username: "pi",
            password: "$2a$08$rV2xy2pQKzuXWmHTY.37Q.IhW/LdjZ8d/t6jIIZ29obz51uhyxxxx",
            permissions: "*"
        },
        {
            username: "demo",
            password: "$2a$08$1xnZ/YX3NvrIWzLa2UJDjeZlQSVKgsDgZt.8uiWw1LBpc9siKxxxx",
            permissions: "read"
        }]
    },

    // To password protect the node-defined HTTP endpoints (httpNodeRoot), or
    // the static content (httpStatic), the following properties can be used.
    // The pass field is a bcrypt hash of the password.
    // See http://nodered.org/docs/security.html#generating-the-password-hash
    httpNodeAuth: {user:"pi",pass:"$2a$08$rV2xy2pQKzuXWmHTY.37Q.IhW/LdjZ8d/t6jIIZ29obz51uhyxxxx"},
    httpNodeAuth: {user:"demo",pass:"$2a$08$1xnZ/YX3NvrIWzLa2UJDjeZlQSVKgsDgZt.8uiWw1LBpc9sixxxx"},

```

---

<div class="post-metadata">

**Author:** ![jan-k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jan-k/32/17738_2.png) [@jan-k](https://discourse.nodered.org/u/jan-k)\
**Post date:** [12 March 2020 02:17 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/4 "2020-03-12T02:17:32Z")

</div>

Thank you for the info.

I had been done for the setting, but why it state login failed... 🤐

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/6/c65da0fd23908e91d5d33a1814570875bd1116f8.png)

Best Regards.

---

<div class="post-metadata">

**Author:** ![ebolisa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ebolisa/32/89203_2.png) [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Post date:** [12 March 2020 07:46 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/5 "2020-03-12T07:46:06Z")

</div>

Have you installed the admin tool and generated the hash password? Also pay special attention to commas and brackets in the settings file.

Also check `node-red-log` for some hints.

---

<div class="post-metadata">

**Author:** ![jan-k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jan-k/32/17738_2.png) [@jan-k](https://discourse.nodered.org/u/jan-k)\
**Post date:** [12 March 2020 07:54 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/6 "2020-03-12T07:54:32Z")

</div>

Dear @ebolisa ,

Yes, I had use the node-red-admin to generate hash password, then paste to the settings.js  
Totally step by step follow the link you provided.

Best Regards.

---

<div class="post-metadata">

**Author:** ![ebolisa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ebolisa/32/89203_2.png) [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Post date:** [12 March 2020 08:16 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/7 "2020-03-12T08:16:18Z")

</div>

Can you paste the settings.js file starting from ` // Securing Node-RED` line?

---

<div class="post-metadata">

**Author:** ![jan-k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jan-k/32/17738_2.png) [@jan-k](https://discourse.nodered.org/u/jan-k)\
**Post date:** [12 March 2020 08:17 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/8 "2020-03-12T08:17:14Z")

</div>

Haha, okay. I will re-do it again. 🤣

---

<div class="post-metadata">

**Author:** ![ebolisa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ebolisa/32/89203_2.png) [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Post date:** [12 March 2020 08:19 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/9 "2020-03-12T08:19:42Z")

</div>

I ment to copy your file and paste it here starting from the ` // Securing Node-RED` line.  
I didn't mean for you to copy and paste my settings.js lines bc will not work.

---

<div class="post-metadata">

**Author:** ![jan-k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jan-k/32/17738_2.png) [@jan-k](https://discourse.nodered.org/u/jan-k)\
**Post date:** [12 March 2020 08:40 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/10 "2020-03-12T08:40:44Z")

</div>

Sorry, I just re-install the node red. Pasted below.

```auto
// Securing Node-RED
    // -----------------
    // To password protect the Node-RED editor and admin API, the following
    // property can be used. See http://nodered.org/docs/security.html for deta $
    adminAuth: {
        type: "credentials",
        users: [
          {
            username: "admin",
            password: "$2a$08$AG5VtLsQxt72ANTMuccB2uHvccVCEIXNsrcN/KG/1TKr4ueQR$r4ueQRM3vO",
                                                                                                                                                             $
            permissions: "*"
         },
         {
            username: "seethozf",
            password: "$2a$08$AG5VtLsQxt72ANTMuccB2uHvccVCEIXNsrcN/KG/1TKr4ueQR$r4ueQRM3vO", $
            permissions: "read"
         }]
    },

    // To password protect the node-defined HTTP endpoints (httpNodeRoot), or
    // the static content (httpStatic), the following properties can be used.
    // The pass field is a bcrypt hash of the password.
    // See http://nodered.org/docs/security.html#generating-the-password-hash
    httpNodeAuth: {user:"admin",pass:"$2a$08$AG5VtLsQxt72ANTMuccB2uHvccVCEIXNsr$EIXNsrcN/KG/1TKr4ueQRM3vO"}, $
    httpStaticAuth: {user:"seetho",pass:"$2a$08$AG5VtLsQxt72ANTMuccB2uHvccVCEIX$cVCEIXNsrcN/KG/1TKr4ueQRM3vO"},

```

---

<div class="post-metadata">

**Author:** ![ebolisa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ebolisa/32/89203_2.png) [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Post date:** [12 March 2020 08:58 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/11 "2020-03-12T08:58:26Z")

</div>

🤔 It looks ok. Not sure if I can add much more to this. Try to remove the extra user.

---

<div class="post-metadata">

**Author:** ![jan-k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jan-k/32/17738_2.png) [@jan-k](https://discourse.nodered.org/u/jan-k)\
**Post date:** [12 March 2020 09:03 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/12 "2020-03-12T09:03:10Z")

</div>

Ya, before this I only set to one user. Still same 😹. Maybe the node-red-admin having generating problem?  
I wonder I can use Bcrypt hash generator online or not.  
[https://bcrypt-generator.com/](https://bcrypt-generator.com/)

---

<div class="post-metadata">

**Author:** ![ebolisa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ebolisa/32/89203_2.png) [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Post date:** [12 March 2020 09:17 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/13 "2020-03-12T09:17:01Z")

</div>

Not sure, try it! You'll not break it 😉

---

<div class="post-metadata">

**Author:** ![jan-k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jan-k/32/17738_2.png) [@jan-k](https://discourse.nodered.org/u/jan-k)\
**Post date:** [12 March 2020 09:17 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/14 "2020-03-12T09:17:38Z")

</div>

😅 Okay, thanks for your help.

---

<div class="post-metadata">

**Author:** ![ebolisa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ebolisa/32/89203_2.png) [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Post date:** [12 March 2020 10:17 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/15 "2020-03-12T10:17:23Z")

</div>

> [@jan-k](#):
>
> httpStaticAuth `: {user:"seetho"`

Have you noticed the different user name? I'd also use different passwords

---

<div class="post-metadata">

**Author:** ![ebolisa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ebolisa/32/89203_2.png) [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Post date:** [12 March 2020 15:04 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/16 "2020-03-12T15:04:06Z")

</div>

Also, make sure when you make changes in the settings, to use http://your\_up:1880 without any other numbers after restarting the service

---

<div class="post-metadata">

**Author:** ![jan-k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jan-k/32/17738_2.png) [@jan-k](https://discourse.nodered.org/u/jan-k)\
**Post date:** [13 March 2020 01:04 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/17 "2020-03-13T01:04:33Z")

</div>

Okay, my problem solved. Because actually I'm using the Node Red in Siemens Simatic IOT2040. And the node-red-admin version has problem or maybe version too old. I just tried to use the node red on my window install the node-red-admin and generate the hash password and paste it there. Finally, it works! haha 😆  
Thanks & Regards.

---

<div class="post-metadata">

**Author:** ![ebolisa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ebolisa/32/89203_2.png) [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Post date:** [13 March 2020 08:19 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/18 "2020-03-13T08:19:45Z")

</div>

Good!! All problems have solutions except one... death 😉

---

<div class="post-metadata">

**Author:** ![Nxito](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nxito/32/88293_2.png) [@Nxito](https://discourse.nodered.org/u/Nxito)\
**Post date:** [13 March 2020 08:27 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/19 "2020-03-13T08:27:17Z")

</div>

Even though the topic is closed, I want to comment that the page to generate passwords that I use is this: [https://passwordhashing.com/BCrypt](https://passwordhashing.com/BCrypt)

---

<div class="post-metadata">

**Author:** ![ebolisa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ebolisa/32/89203_2.png) [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Post date:** [13 March 2020 08:43 UTC](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774/20 "2020-03-13T08:43:23Z")

</div>

Good to know.  
I had the same problem as yours yesterday on a new SD card. I didn't waste much time searching for the problem so I removed the node-red app, which came with the OS, and installed a new copy. Modified the settings.js file and the app worked just fine.

[Next page](https://discourse.nodered.org/t/how-to-add-a-demo-user-closed/22774.md?page=2)
