| 1 |
NAME |
| 2 |
Authen::Simple::Passwd - Simple Passwd authentication |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
use Authen::Simple::Passwd; |
| 6 |
|
| 7 |
my $passwd = Authen::Simple::Passwd->new( |
| 8 |
path => '/etc/passwd' |
| 9 |
); |
| 10 |
|
| 11 |
if ( $passwd->authenticate( $username, $password ) ) { |
| 12 |
# successfull authentication |
| 13 |
} |
| 14 |
|
| 15 |
# or as a mod_perl Authen handler |
| 16 |
|
| 17 |
PerlModule Authen::Simple::Apache |
| 18 |
PerlModule Authen::Simple::Passwd |
| 19 |
|
| 20 |
PerlSetVar AuthenSimplePasswd_path "/etc/passwd" |
| 21 |
|
| 22 |
<Location /protected> |
| 23 |
PerlAuthenHandler Authen::Simple::Passwd |
| 24 |
AuthType Basic |
| 25 |
AuthName "Protected Area" |
| 26 |
Require valid-user |
| 27 |
</Location> |
| 28 |
|
| 29 |
DESCRIPTION |
| 30 |
Authenticate against a passwd file. |
| 31 |
|
| 32 |
METHODS |
| 33 |
* new |
| 34 |
This method takes a hash of parameters. The following options are |
| 35 |
valid: |
| 36 |
|
| 37 |
* path Path to passwd file to authenticate against. Any standard |
| •38 |
passwd file that has records separated with newline and |
| 39 |
fields separated by ":" is supported. First field is |
| 40 |
expected to be username and second field, plain or encrypted |
| 41 |
password. Required. |
| 42 |
|
| 43 |
path => '/etc/passwd' |
| 44 |
path => '/var/www/.htpasswd' |
| 45 |
|
| 46 |
* flock A boolean to enable or disable the usage of "flock()". |
| 47 |
Defaults to "d_flock" in Config. |
| 48 |
|
| 49 |
flock => 0 |
| 50 |
|
| 51 |
* log Any object that supports "debug", "info", "error" and |
| 52 |
"warn". |
| 53 |
|
| 54 |
log => Log::Log4perl->get_logger('Authen::Simple::Passwd') |
| 55 |
|
| 56 |
* authenticate( $username, $password ) |
| 57 |
Returns true on success and false on failure. Authentication |
| 58 |
attempts with a username that begins with a hyphen "-" will always |
| 59 |
return false. |
| 60 |
|
| 61 |
SEE ALSO |
| 62 |
Authen::Simple. |
| 63 |
|
| 64 |
Authen::Simple::Password. |
| 65 |
|
| 66 |
passwd(5). |
| 67 |
|
| 68 |
AUTHOR |
| 69 |
Christian Hansen "[email protected]" |
| 70 |
|
| 71 |
COPYRIGHT |
| 72 |
This program is free software, you can redistribute it and/or modify it |
| 73 |
under the same terms as Perl itself. |
| 74 |
|