Search found 1 match

by patefil
Fri Oct 22, 2021 4:55 pm
Forum: ESP-IDF
Topic: Basic authentication with the ESP-IDF HTTPS-Server
Replies: 12
Views: 13467

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...