Hello,
I have securely created Username/password based authentication from Node red documentation.
I am a beginner in node red
same like this in settings.js file
but i am not able to log in with the password.
which password should be used during log in in browser i.e. localhost:...
thanking you.![node%20red|690x309](upload://A8gER88Q9P5NGbZKgLsHlGVzPX7.png)
Check if it could be related to one of the below issues:
1- Modifying the wrong settings.js file (yep, there is more than one in your system). While Node-RED is initializing it will show in the screen log which settings.js file is used. You should modify that file.
2- Make sure you added the configuration lines in the right place in the settings.js file. It should be included under the module.exports session. To be in the safe side it may be better to search and uncomment the lines from the file.
thank you for you reply.
i checked the above given info.
its all correct. but for log in its not accepting the password given there.
What password should i use?
You need to follow the link to the security.html page and follow the instructions to create your own password hash that replaces the "$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."
you then restart Node-RED so it reads the file containing your password hash and log in with your password.
thank you for you reply. i followed all these steps.
"$2b$08$gzkXWJA3Zd2RzpXqL7uPsOqyHsF628QCF9CYHCywVcz3Gqe56N4ta.",
this is what my password in settings.js file looks like.
but with this i am not able to login.
in command promt
this created password. and i copied it and pasted into setttings.js file in node-red.
and then i used it to log in into node red.
but not working.
The users property is an array of user objects. This allows you to define multiple users, each of whom can have different permissions.
This example configuration defines a single user called admin who has permission to do everything within the editor and has a password of password . Note that the password is securely hashed using the bcrypt algorithm.
Note : in previous releases of Node-RED, the setting httpAdminAuth could be used to enable HTTP Basic Authentication on the editor. This option is deprecated and should not be used.
Generating the password hash
To generate a suitable password hash, you can use the node-red-admin command-line tool. Instructions for installing the tool are available here.
node-red-admin hash-pw
The tool will prompt you for the password you wish to use and then print out the hash that can be copied into the settings file.
Which settings.json file did you edit?
Post the log you see when you restart node-red, starting with the Welcome to node-red message, up to the point where you try to log in.
Thank you for all your help.
I got the point about the password generated by hash.
so I used the Hash password which converts it into a simple password.
The password is not generated by the hash, you are supposed to enter the password you want in the admin tool and it generates the hash for that password for you to put in the settings file.