• 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

Making Your ESP32 Web Server Password Protected

Q&A Forum › Category: ESP32 › Making Your ESP32 Web Server Password Protected
0 Vote Up Vote Down
BillB asked 6 years ago

How does the authentication window get initiated in this example?
The server.begin(80) and similar statements looks the same as the non protected examples.
Authentication statement  if(header.indexOf(“dXNlcjpwYXNz”) >= 0)
also looks similar to user buttons if (header.indexOf(“GET /26/on”) >= 0)

Question Tags: ESP32 Authenication
1 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Hello Bill, in summary for that project we’re using “Basic Access Authentication” (which uses base64 encoding). The form that requests the username/password is automatically generated by your web browser.
That statement verifies if you’ve entered the user/password in the form by searching for the encoded string in your request (dXNlcjpwYXNz):

if(header.indexOf(“dXNlcjpwYXNz”) >= 0)

The button presses are very similar, because if you access that URL that part comes in your request “GET /26/on”

if (header.indexOf(“GET /26/on”) >= 0)

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

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition 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.