cotestatnt / esp-fs-webserver

ESP32/ESP8266 webserver, WiFi manager and web editor Arduino library
MIT License
105 stars 27 forks source link

Feature Request : Add WiFi PEAP Auth #27

Closed hallard closed 4 months ago

hallard commented 1 year ago

Just discovered this awesome lib, until there was using ESPAsync, but will migrate to this one.

Would it be complicated to add option to have PEAP WiFi option? (adding one field on WebServer WiFi option)

We're in a company building where wifi is not open but works with PEAP, on Arduino ESP32 we just do something like that and it's working fine, not sure how to achieve here.

  // we got PEAP Auth config?
  if (EAPname!="" && EAPuser!="" && EAPpass!="" ) {
    WiFi.begin(EAPname, WPA2_AUTH_PEAP, EAPuser, EAPuser, EAPpass);
    // wait 30s to connect
    if (!checkAPConnection(30)) {
      Serial.print("Failed to connect using PEAP Auth, fallback to classic");
    }
  }

  // in case PEAP failed or not configured, just use classic WiFi SSID/Pass
  if (WiFi.status() != WL_CONNECTED) {
    WiFi.begin(APname, APpass);
    connected = checkAPConnection(45);
  }

Thanks

cotestatnt commented 1 year ago

Hi @hallard

The functioning of the webserver is not strictly linked to the connection method you use for WiFi. You could simply connect as you do now not using the method implemented in the library and then run the webserver.

hallard commented 1 year ago

thanks @cotestatnt, yes I can do that outside this lib of course, but since WiFi credential and connection is already done in setup of this lib I was thinking adding this option in the same place would be fine :-) And best of all, this would allow project using this lib to have this native PEAP feature just updating the lib.