Search found 1 match
- Fri Oct 22, 2021 4:55 pm
- Forum: ESP-IDF
- Topic: Basic authentication with the ESP-IDF HTTPS-Server
- Replies: 13
- Views: 14708
Re: Basic authentication with the ESP-IDF HTTPS-Server
Use the following esp_err_t httpRequestAuthorization(httpd_req_t *req) { httpd_resp_set_hdr(req, "WWW-Authenticate", "Basic realm=\"my_realm1\""); httpd_resp_set_status(req, "401 Unauthorized"); httpd_resp_set_type(req, HTTPD_TYPE_TEXT); httpd_resp_sendstr(req, "Unauthorized"); return ESP_OK; } bool...