I have been looking for user/password html authentication for the esp8266. I discovered some code on github that shows basic authentication (which may not be that secure) is not very difficult to implement. It works on my esp8266 server. This is a link to the whole server code:
https://github.com/RuiSantosdotme/Rando ... cation.lua
All one needs to do to add basic authentication is to include the following lines of code in the file attached.
The part I found puzzling at first is that I did not understand the username/password pair are encrypted in base64 for transmission on the network. Thus to match in a comparison statement one must enter the corresponding encoded username/password string within the server code. To do this one can use the base64 encoder at https://www.base64decode.org/. For example user:pass yields dXNlcjpwYXNz which matches the example given in the github code.
tma