Esp32CameraRover2 icon indicating copy to clipboard operation
Esp32CameraRover2 copied to clipboard

Implement basic authentication for the rover's web ui and web socket api

Open Ezward opened this issue 1 year ago • 0 comments

Currently any one can control the robot if they have or can guess its IP address. We want to add optional basic authentication such that the user can configure username and password that is compiled into the firmware and is used for basic authentication. If either the username or the password is empty then no authentication is done. If both the username and password are not empty then they are used as the credentials for the web ui and web socket api as follows:

  • The use is challenged for a username and password using the browser's default basic authentication dialog when the user opens the web ui.
  • The web server checks the Authorization header for the web ui GET and the web socket GET as follows;
    • If the Authorization header is missing then the request fails with a 401 Not Authorized response
    • If the Authorization header exists but does not match the configured username and password then the request fails with a 403 Forbidden response.
    • If valid of the Authorization header matches the configured username and password then the requests succeed.

Ezward avatar May 01 '23 21:05 Ezward