-->
Page 1 of 1

How to add simply authorization to web server

PostPosted: Mon Apr 22, 2019 3:29 pm
by twinclouds
I built a wifi garage door opener using ESP01 based on what described here https://www.instructables.com/id/Smart-Phone-WiFi-Controlled-Garage-Door-Opener-Wit/. It works fine over my home local net. However, since I want to access it over internet, I would like to add some simple authorization such as login with password. I found quite a few examples on the web. For example like this one https://github.com/esp8266/ESPWebServer/commit/c67fb968ed41de35dfaf5eab9404ca1cce281648. They all work fine for performing the function of login using password. However, I don't know how to modify the code so that once authenticated, I can execute the garaging opening function. I think it should not be difficult but I just cannot figure it out. Can someone help? Really appreciated!

Re: How to add simply authorization to web server

PostPosted: Tue Apr 23, 2019 4:11 am
by QuickFix
I've never tried, used or even seen this code before, but if I'm correct you can do your stuff by replacing the line by your own code at:
Code: Select allserver.send(200, "text/plain", "Login OK");