http.server support for HTTP basic authentication, response 401

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Can the http.server support basic HTTP authentication?   I know that there aren't any examples in the code provided, but wondering if anyone has coded support for this?   It doesn't look like the code 401 is included in the supported response codes. 

I'd like to password protect some configuration webpages and the basic HTTP authentication provides the acceptable level of protection.  

If it is not possible to support basic HTTP authentication with http.server, is there any other preferred or systematic method of password protecting some web pages served by http.server?  (possibly through the webpage database?).  

Thanks,

0 Likes
1 Solution
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

The http_server does not support basic authentication. The status code and related details for basic authentication are not implemented WICED. You can implement the basic authenticator by adding the required status code and add basic auth capabilities to web server(so that it understands the user_name:password sent by the client).

If your looking for secure web server, we would recommend you to have a look at https_server snip in WICED. This snip app connects to a Wi-Fi network as a STA (client), then starts a secure web-server and waits for requests.

View solution in original post

1 Reply
PriyaM_16
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

The http_server does not support basic authentication. The status code and related details for basic authentication are not implemented WICED. You can implement the basic authenticator by adding the required status code and add basic auth capabilities to web server(so that it understands the user_name:password sent by the client).

If your looking for secure web server, we would recommend you to have a look at https_server snip in WICED. This snip app connects to a Wi-Fi network as a STA (client), then starts a secure web-server and waits for requests.