[Catalyst] Catalyst and LDAP with sessions
Birger Burkhardt
sysdev41 at googlemail.com
Fri Feb 24 13:22:04 GMT 2012
Hello all,
since my last mail to the mailing list was abused by other people for
their thread ("Catalyst 5.90010 server must be in CWD to run?"), i am
posting my question again, hoping that someone else has experience with
catalyst and LDAP.
I would like to use catalyst framework for a ldap authenticated web
interface. Anonymous bind is not allowed so I have configured binddn and
bindpw in the config. After successful authentication, all further request
should be executed via the credentials of the logged in user.
In the login controller the user is authenticated
[...]
# Get the username and password from form
my $username =3D3D $c->request->params->{username};
my $password =3D3D $c->request->params->{password};
# If the username and password values were found in form
if ($username && $password) {
# Attempt to log the user in
if ($c->authenticate({ username =3D3D> $username,
password =3D3D> $password })) {
[...]
But when I do a new request from within another controller, i get an ldap
error meaning the credentials are invalid:
code in other controller:
[...]
my $ldapconn =3D3D $c->user->ldap_connection();
my $mesg =3D3D $ldapconn->search( base =3D3D> "ou=3D3Dusers,dc=3D3D=
example,=3D
dc=3D3Dcom",
filter =3D3D> "(uid=3D3D*)");
my @entries =3D3D $mesg->sorted('uid');
$c->stash(users =3D3D> \@entries,);
$c->stash(template =3D3D> 'userList.tt2');
[...]
I use sessions:
Session
Session::Store::FastMmap
Session::State::Cookie
Can anybody give me a hint how to solve this problem?
Best regards,
Birger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20120224/dbb76=
7cc/attachment.htm
More information about the Catalyst
mailing list