• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

mount-origin/23-Nov-2023-157150

mount-secret-origin/23-Nov-2023-7975

CMakeLists.txtD23-Nov-20232.1 KiB8071

README.mdD23-Nov-2023868 3522

ba-passwordsD23-Nov-202314 21

minimal-http-server-basicauth.cD23-Nov-20233.2 KiB11474

README.md

1# lws minimal http server basic auth
2
3This demonstrates how to protect a mount using a password
4file outside of the mount itself.
5
6The demo has two mounts, a normal one at / and one protected
7by basic auth at /secret.
8
9The file at ./ba-passwords contains valid user:password
10combinations.
11
12## Discovering the authenticated user
13
14After a successful authentication, the `WSI_TOKEN_HTTP_AUTHORIZATION` token
15contains the authenticated username.
16
17## build
18
19```
20 $ cmake . && make
21```
22
23## usage
24
25```
26 $ ./lws-minimal-http-server-basic-auth
27[2018/04/19 08:40:05:1333] USER: LWS minimal http server basic auth | visit http://localhost:7681
28[2018/04/19 08:40:05:1333] NOTICE: Creating Vhost 'default' port 7681, 1 protocols, IPv6 off
29```
30
31Visit http://localhost:7681, and follow the link there to the secret area.
32
33Give your browser "user" and "password" as the credentials.
34
35