Hi,
I loaded the example program in esp32 and only once it asked me user and password. If I try to entry the web page after closing it, the identifications fields are not displayed and it is possible to use the web interface without any identification, even using other browers the same problem occurs.
Do you have any suggestions about this?
A Thousand Thanks
Hi.
What is exactly the project that you’re following? What is the eBook you’re following?
If you want the fields to appear again, you need to clear the cache of your web browser.
Alternatively, you can access the web server using incognito mode.
Regards,
Sara
Hi Sara,
thank you for your answer.
I’ll try to tell you all the things that you request.
The reference about the ebook is “Learn ESP32 with Arduino IDE”.
I uploaded the sketch from the chapter – ESP32 Web Server – Unit 6.
I used the following instructions:
if(header.indexOf(“dXNlcjpwYXNz”) >= 0) {
// Your web server homepage
}
else {
client.println(“HTTP/1.1 401 Unauthorized”);
client.println(“WWW-Authenticate: Basic realm=\”Secure\””);
client.println(“Content-Type: text/html”);
client.println();
client.println(“<html>Authentication failed</html>”);
}
I confirm your advice on incognito mode, but if every time I have to clear the cache to use the web page is certainly not friendly.
Could you suggest something more operational?
Best regards
Vincenzo
Hi.
That is a very basic example for learning purposes only.
For something more “advanced”, you need to learn more about web servers. We have this example:
But, it uses a different method to code the web server.
Regards,
Sara
Hi Sara,
thank you for your answer, I haven’t tried it yet.
I hope to do it as soon as possible.
have a good weekend