From: Igor Böhm Date: Sat, 30 Oct 2021 23:59:12 +0000 Subject: [PATCH] rc-httpd(8): document how to use HTTP basic authentication --- diff 76990597f21f5ec3972403e8afbc18dba80ddabe f525323da61d6f06592dc5cd3f09a4ab9f833d45 --- a/sys/man/8/rc-httpd Sat Oct 30 00:59:06 2021 +++ b/sys/man/8/rc-httpd Sun Oct 31 01:59:12 2021 @@ -80,6 +80,11 @@ be configured via a similar method acting upon the .I location and/or other variables. +.PP +The +.I REMOTE_USER +variable provides a user identification string supplied by the +client as part of user authentication. .SH EXAMPLES The following examples demonstrate possible ways to configure .BR select-handler. @@ -95,6 +100,20 @@ .EE .RE .PP +HTTP basic authentication: +.RS +.EX +if(~ $SERVER_NAME *restricted.org){ + PATH_INFO=$location + FS_ROOT=/usr/kgb/www/$SERVER_NAME + authorize + if(~ $REMOTE_USER (glenda kgb)) + exec static-or-index + error 401 +} +.EE +.RE +.PP CGI: .RS .EX @@ -151,6 +170,8 @@ .B /rc/bin/rc-httpd/rc-httpd .TP .B /rc/bin/rc-httpd/select-handler +.TP +.B /rc/bin/rc-httpd/handlers/authorize .TP .B /rc/bin/rc-httpd/handlers/cgi .TP