Forum

HTTP authentication for more than one user.

raspiham
13 September 2017, 17:55
Hi again Hugo,

After successfully setting-up a password using digest HTTP authentication I should like to extend the feature (if possible) to include more than one user/password combination. Looking at this page...
https://www.hiawatha-webserver.org/howto/http_authentication
I suspect I should be using the "groups" option but I am unshure how to proceed.
Ragards,
raspiham
Hugo Leisink
13 September 2017, 20:29
You can add more users by simply adding more lines to your password file as generated by wigwam.
raspiham
16 September 2017, 11:58
Hi Hugo,
Many thanks for the swift reply. I have partial success.
I have three servers running under Hiawatha, the default port 80, a virtual server on port 998 with PHP and a second virtual server on port 999 each with its own password. But is it possible to have multiple users/passwords for the same server? So for example, could I have say three seperate users each with there own password but all on virtual server #1 ?
Regards,
raspiham
Hugo Leisink
18 September 2017, 11:21
The answer to your question is the same as my previous post, so my guess is that you're looking for something else. So you mean that all three ports show the same website, but you want only 1 of the ports to ask for a password? If asking for a password or not is based on the IP address of the visitor, take a look at the pwd option of the AccessList setting. Otherwise, define 3 virtual hosts with only one asking for a password and use the BindingID and the RequiredBinding settings to bind virtual hosts to a port.
raspiham
19 September 2017, 16:32
Hi again Hugo,
Sorry, my last posting contained to much information and was badly written using incorrect terminology :-(
What I meant to ask...
Can any one of the web-sites hosted on the hiawatha server have more than a single password. So for example, one of my virtual web-servers is on port 998 and currently has a single password. Lets say the password is "cats"
Could I have more than one password for that server such that one user could use "cats" while a second user might have "dogs" as the password to the same port 998 virtual server? So two or more users each with personal passwords but all loging on to the same port 998 server?
Regards,
raspiham
Hugo Leisink
19 September 2017, 19:46
Simply add multiple lines to your password file. For example:
user1:$1$NgPZr/kS$Ryv8.77Yrd/fLRTp5ecAZ.
user2:$1$NgPZr/kS$ZPyBObSl7trFb9XUCiKnD1
raspiham
21 September 2017, 18:13
Hi again Hugo,
Thankyou for your prompt response.
Everything is working ok now with multiple user/password combinations for all servers running on my Hiawatha/raspberry-pi platform.

The problem was my incorrect use of syntax while using the wigwam digest password option.
Thanks again for your patience.
Regards,
raspiham
This topic has been closed.