I try to create a simple REST Server using Nodered v0.18. To protect the node i download node-red-contrib-httpauth which can offer Basic credential to access http node. Pretty normal at this stage.
So the node
INPUT:HTTP -> httpauth -> OUTPUT:HTTP
INPUT:HTTP properties
Method = GET
URL = /rest/test.json
Name = Auth
I would want to create multiple login username/password pair. So the best configuration in httpauth is using "File".
I had created a .txt file with these content
username1:realm1:password1
username2:realm1:password2
username3:realm1:password3
Store in E:\somefilename.txt
Then I Add new node-red-contribs-httpauthfile
Name = anyname
Auth Type = Basic
Realm = realm1
File = E:\somefilename.txt
In Edit HTTP auth node page
Name = anyname
Auth Type = Basic
Realm = realm1
Username =
Password =
Hashed = false or untick
Then I go to URL http://thisismytestdomain.com:1880/rest/test.json Basic credential dialog pop up "at least this part working"
I try to put username1, username2 cannot log in or the wrong credential. Then it goes through with username3 I try to change the hierarchy like
username3:realm1:password3
username2:realm1:password2
username1:realm1:password1
It always the bottom one get authenticated.
Not sure why. Try to google and go to GitHub to understand the code. No luck The code in GitHub looks logic and should be working but not sure why it always able to pick the last entry only.