I cannot create a username and password

I cannot create a username and password. I follow the instructions on the installation page, but I cannot get positive results.
the problem command : settings.js
node-red version: v3.1.0
macOs

Hi,
That's not how you should do it, it's described here

Which installation page?

I too can't. Resorted to just uncommenting the file:

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

Still doesn't work even with default name and password. Where is the error in that code?

Edited to add: Checked command above has comma and if I recomment it works again. Log happy.


Every time:

Edited to add: Coloured squares making an X are a password manager I've checked it is not autofilling nonsense

2nd edit: Tried Firefox and Edge browsers

3rd edit: Not hashing password

Hi,
To create a hashed password, run

node-red admin hash-pw

Then enter your password and the result is a hashed code.

With this hashed code go to the settings file and replace the password line with the code.

In the editor you must use de password not the hash to login.

1 Like

I'm not at the hashing stage yet. I can't get even an unhashed code to work even if I just uncomment that paragraph.

Because when you enter a password in the editor it is hashed to compare it to the one defined in the settings.

Password needs to be hashed.

  1. Generate the hash for your password
  2. Set the hash in settings.js
  3. Restart Node RED
  4. log on with the un-hashed version
1 Like

thanks. I was going step by step. Thought plain text first. When you say:
node-red admin hash-pw
Is this in terminal?
I need to find how to access a terminal on my device.

Yes, or use a web based generator.
Bcrypt-Generator.com - Generate, Check, Hash, Decode Bcrypt Strings

The hash algorithm is BCrypt - just be mindful about using external tools, whilst mostly fine to use, feel I should offer that caution.

1 Like

thanks! I just have missed the bit where I needed to insert the hashed version of the password. I was using a 20 digit password manager derived password so it looked like that anyway.

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