Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
mount-origin/ | 12-May-2024 | - | 157 | 150 | ||
mount-secret-origin/ | 12-May-2024 | - | 79 | 75 | ||
CMakeLists.txt | D | 12-May-2024 | 2.1 KiB | 80 | 71 | |
README.md | D | 12-May-2024 | 868 | 35 | 22 | |
ba-passwords | D | 12-May-2024 | 14 | 2 | 1 | |
minimal-http-server-basicauth.c | D | 12-May-2024 | 3.2 KiB | 114 | 74 |
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