I am running Catalyst 5.90042, Perl v5.10.1, on Red Hat Enterprise Linux Server release 6.4
The configuration in Config::General format
<Plugin::Authentication>
<default>
<store>
class LDAP
ldap_server ldap://ldap.server:3268
binddn bind@domain
bindpw password
user_basedn basedn
user_field samaccountname
user_filter (sAMAccountName=%s))
user_scope sub
<user_search_options>
dref always
</user_search_options>
</store>
<credential>
class Password
password_type self_check
password_field password
</credential>
</default>
</Plugin::Authentication>
The Controller module action
sub login : Local {
my ( $self, $c ) = @_;
if ( my $user = $c->req->params->{user}
and my $password = $c->req->params->{password} )
{
if ( $c->authenticate( { login => $user,
password => $password,
})) {
$c->response->redirect($c->uri_for('/'));
}
else {
# login incorrect
use Data::Dumper;
$c->response->body("Login Incorrect");
}
}
else {
# invalid form input
$c->response->body("Form Input Invalid");
}
}
|