Actions
Feature #1845
closedMySQL Digest Authentication
ASK QUESTIONS IN Forums:
Description
This patch allows lighttpd to authenticate users against MySQL using digest authentication.
(For a patch using basic auth for Lighttpd 1.4.18, see #752. But keep in mind that basic auth does not use any encryption.)
Add this to lighttpd.conf to configure the module:
#### auth module auth.backend = "mysql" auth.backend.mysql.host = "$db_host" auth.backend.mysql.user = "$db_user" auth.backend.mysql.pass = "$db_pass" auth.backend.mysql.db = "$db_name" auth.backend.mysql.port = "0" # (for default port 0, always needed) auth.backend.mysql.socket = "" # (for default leave blank, always needed) auth.backend.mysql.users_table = "http_digest_auth" auth.backend.mysql.col_user = "username" auth.backend.mysql.col_pass = "password" auth.backend.mysql.col_realm = "realm"
And to use it (same as every other auth):
auth.require = ( "/some_path" => ( "method" => "digest", "realm" => "some_realm", "require" => "valid-user" ))
Finally, create the MySQL table. The values for the "password" column can be generated using htdigest or
MD5(CONCAT(username,':',realm,':',plaintext_password))
If you already have a table containing usernames and plaintext passwords, you can simply create a view:
CREATE VIEW http_digest_auth AS SELECT username AS username, MD5(CONCAT(username,':',realm,':',plaintext_password)) AS password, realm AS realm FROM http_basic_auth
Thanks to DrJeckyll and Taguchi for their work on #752.
Files
Updated by gstrauss about 8 years ago
- Status changed from New to Fixed
- % Done changed from 0 to 100
Applied in changeset ae91578895bd7239d1bfd9f73d75a2039cb26ae3.
Actions
Also available in: Atom