[Libwebsockets] How to reply a "WWW-Authenticate" field ?

Andy Green andy at warmcat.com
Thu Jul 21 01:15:23 CEST 2016


On Wed, 2016-07-20 at 19:08 +0000, Shmuel Weiss wrote:
> Hi All,
>  
> What is the right way to reply
> WWW-Authenticate: Basic realm="User Visible Realm"
>  
> Into this authentication failure response ?
>  
> if (authentication_is_on && authentication_failed )
> {
>              lwsl_err("authentication failed %s\n", buf);
>              lws_return_http_status( wsi,
>                        HTTP_STATUS_UNAUTHORIZED, NULL);
>              return -1;
> }

Not sure exactly what you're asking, but:

 - https://en.wikipedia.org/wiki/Basic_access_authentication

 - See lws_b64_encode_string()

https://libwebsockets.org/lws-api-doc-master/html/group__sha.html#gaf39
765e4a3b413efb65e4698b2ec3575

-Andy

> Thanks.
>  
>     	 Shmuel Weiss Kramer Electronics     Project Lead and
> Software Team Leader     
>  
>  Email: sweiss at kramerel.com    Web: www.kramerelectronics.com    Tel:
>  +972-73-2650405     Cell: +972-54-3344141    Fax: +972-2-
> 6535369    Address: 3 Am VeOlamo, Jerusalem, 9546303, Israel     
>    
>  
>  
> This mail was sent via Mail-SeCure System.
>  _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> http://libwebsockets.org/mailman/listinfo/libwebsockets



More information about the Libwebsockets mailing list