in reply to CGI::Application::Plugin::Authentication, switch from DBI to htpasswd

I think .htpasswd files are colon separated files. In the first column is the user name and in the second column is the (has of the) password. Or something like this - I've only interacted with them using the htpasswd program. But the username and password are stored positionally in the htpasswd files.

On second thought, likely the format is just the same as of plain passwd files.

Replies are listed 'Best First'.
Re^2: CGI::Application::Plugin::Authentication, switch from DBI to htpasswd
by chris- (Initiate) on Jan 16, 2009 at 12:05 UTC
    Here is how it works:
    $self->authen->config ( DRIVER => [ 'Authen::Simple::Passwd', path => '/srv/www/cgi-bin/WebApp4/.htpasswd', ], );
    If passwords in htpasswd file are encrypted with md5, it decrypts it with md5, if it is with crypt() then it uses crypt() for decrypting. No options needed! To know that makes live easier.
Re^2: CGI::Application::Plugin::Authentication, switch from DBI to htpasswd
by chris- (Initiate) on Jan 13, 2009 at 14:56 UTC
    Update: The code just seems to work if I stick to unix crypt() and my code as mentioned above.

    But how can I use CGI::Application::Plugin::Authentication with the more secure md5 method with htpasswd?