Recommended
| DekiWiki apache2 authentication against MySQL |
|
|
|
| Articles - Technology | |||
| Written by Bob | |||
| Wednesday, 05 March 2008 14:05 | |||
|
So, I have a dekiwiki Normally Apache2 auth dbd expects the passwords to be stored as a simple hash but deki is more cunning: crypt_pass = md5( user_id & "-" & md5( clear_password ) ) Which is fun, so I had to go to mod_authnz_external AddExternalAuth dekisql-auth /usr/sbin/dekisql-auth.pl This was in the body of the apache site config for ssl (within the section for <VirtualHost *:443>). Then another section in there restricts access: <Location /> Then finally there is the script, all it happens to be is the SQL script supplied with the external authnz module with some changes: my $dbq = $dbh->prepare("select user_name as username, user_password as password, and under the "accepted" conditional statement change it to if ($row->{password} eq md5_hex($row->{userid} . '-' . md5_hex($pass))) {To aid diagnostics I also added a line to the "else" after accepted to show what happened if the password was rejected: print STDERR $row->{userid} . " - " . md5_hex($row->{userid} . '-' . md5_hex($pass)) . "\n";That is all... I hope perhaps you find this useful in getting your wiki secured. As always, I invite comment.... blog comments powered by Disqus
|



