adminAuth not working windows 7

#1

Hello

I have a problem with adminauth to set password for my node-red running on windows 7 ultimate 64-bit. I can get it working with my debian stretch.

Win7: node version v10.15.0 and npm version 6.4.1
Debian: node version 8.12.0 and npm version 6.4.1

Is the newer node version causing this?

Thank you in advance.

0 Likes

#2

Hi @Protop

the use of Node 10 is unlikely to have broken something in this area.

What exactly have you tried so far?

Nick

0 Likes

#3

I have uncommented adminAuth in settings.js and entered a password generated with node-red-admin hash-pw. This works with my debian node-red and asks user credentials before i can use web editor but this doesn't work with my windows 7 node-red.

EDIT:

Node-red version in windows 7: v0.19.5
Node-red version in debian: v0.19.3

0 Likes

#4

When you say it doesn't work, do you mean that it lets you in without asking for a password, or it asks but won't accept it, or what?
Post the node red startup log up to the point you try to login.

0 Likes

#5

It lets me in without asking login credentials. Just goes straight in and i have never entered these credentials so the password shouldn't be saved anywhere in my browser and thus let me in without asking it.

I have also tried with another computer in LAN network and it doesn't either ask anything credentials to log in.

kuva

Can't provide you any log info from startup because it never ask the credentials.

0 Likes

#6

Hi Nick, please correct me if I am wrong. The hash stored in settings.js for AdminAuth is based on bcrypt.js, right?

As per bcrypt github page it is necessary to use bcrypt.js version >= 3 for node 10.

Node-RED is using bcrypt:"2.4.3", right ?

May this be the root cause of the issue ?

r-01

0 Likes

#7

I meant the node red log. Restart node red and copy/paste what you see in the terminal. It starts with a Welcome to node-RED message.

0 Likes

#8

Here you go:

0 Likes

#9

Also - are you editing the correct settings.js file ? (the correct one is listed in the console during startup).

0 Likes

#10

I think you have solved my issue. I was in the wrong place, i haven't modified this and will try now!

EDIT:

It works now! Thank you dceejay!

I am using nssm to start node-red and i am using C:\Users\USERNAME\AppData\Roaming\npm\ directory to start node-red. Then i thought the settings file is in C:\Users\USERNAME\AppData\Roaming\npm\node_modules\node-red and edited it, which was wrong.

0 Likes