• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 Password Protected Webserver

Q&A Forum › Category: ESP32 › ESP32 Password Protected Webserver
0 Vote Up Vote Down
Vincenzo Dimarco asked 2 years ago

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

Question Tags: password webserver
5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

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

0 Vote Up Vote Down
Vincenzo Dimarco answered 2 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

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:

  1. https://randomnerdtutorials.com/esp32-esp8266-web-server-http-authentication/

But, it uses a different method to code the web server.
 
Regards,
Sara

0 Vote Up Vote Down
Vincenzo Dimarco answered 2 years ago

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

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Great.
Let me know if you can make it work.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.