RequireHTTPLogin (open)
Require basic login/password verification for a page. Aborts on login failure. This allows you to implement trivial authentication for eg feeds and APIs but is not intended as a full-fledged login system for hundreds of users
Syntax
LOADLIB "mod::system/lib/webserver/auth.whlib";
STRING FUNCTION RequireHTTPLogin(STRING realm, RECORD ARRAY accounts, RECORD options)Parameters
STRING realmRealm name. This is usually shown in the HTTP Basic auth popup to show what you're logging in to
RECORD ARRAY accountsValid accounts
STRING passwordRaw password (case sensitive)
STRING passwordkeyPassword registry key. This can be set using `wh registry set --password ``
STRING usernameUsername (case insensitive)
RECORD optionsReturn value
STRINGUsername with which the user logged in. Does not return if login failed but sends a 401 Authorization required instead