Home  Contents

httpd:finduser

Httpd Core4 Lua Event System

SYNOPSIS

hash = function httpd:finduser(cgi, username) ... end

DESCRIPTION

This callback is called during basic authentication when using cgi:authenticate().

Together with a handle for the current request in cgi, it receives the user name that was provided by the client in the variable username.

The function's task is to check if that username exists and retrieve the hashed password of the user. The password must be returned in the format used by cipher.crypt().

If the user does not exist, return false.

To use default authentication, return nil.

The default authentication expects the user name to be admin. The password is read by calling kconfig.value("c4s_general", "c4t_gen_password"). This also uses the format as provided by cipher.crypt().
The Core4 Manager can be used to store an encrypted password at this location.