<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">Tomas Doran <bobtfish@bobtfish.net></font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">The elegant MVC web framework <catalyst@lists.scsys.co.uk></font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">05/21/2012 09:47 AM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">Re: [Catalyst] LDAP question</font></table>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2><br>
On 21 May 2012, at 15:20, Kenneth S Mclane wrote:<br>
<br>
> I am continuing on my journey to duplicate a web app for administering
a db. I have all my pages up and running, as well as search functionality.
I decided to attack authentication next. I am using a php pages from
a different web app to get the settings for our LDAP server. <br>
> <br>
> //Connect to ldap server <br>
> $ds=ldap_connect("xxx.xxx.xxx.xxx");
<br>
> if ($ds) { <br>
> //Get ID for intranet user <br>
> $sr=ldap_search($ds,
"ou=ldap.server, o=domain.com", "mail=$username");
<br>
> $info = ldap_get_entries($ds,
$sr); <br>
> for ($i=0;
$i<$info["count"]; $i++) { <br>
>
$uid=$info[$i]["dn"]; <br>
> } <br>
> <br>
<br>
<snip><br>
<br>
>
credential => { <br>
>
class
=> 'Password', <br>
>
password_field
=> 'password', <br>
>
password_type
=> 'self_check', <br>
>
},<br>
<br>
You don't want self_check here I don't think.</font></tt>
<br>
<br><tt><font size=2>Since the php code didn't have anything here I was
going off docs and examples. I set it to clear but it made no difference.
I am not aware of any other settings, haven't had time to research that
as yet.<br>
<br>
> <br>
>
store => { <br>
>
binddn
=> "username", <br>
>
bindpw => "password",
<br>
>
class
=> 'LDAP', <br>
>
ldap_server
=> '9.17.186.253', <br>
>
ldap_server_options
=> { timeout => 30 }, <br>
>
user_basedn
=> 'o=domain, o=com', <br>
<br>
Original code has:<br>
> "ou=ldap.server, o=domain.com<br>
<br>
<br>
as the base? (Although a base higher up the tree should be fine)</font></tt>
<br>
<br><tt><font size=2>I have added and removed that, makes no difference.<br>
<br>
>
user_field
=> 'mail', <br>
>
user_filter
=> '(&(mail=%s)(objectclass=person))', <br>
<br>
You're searching more restrictively than the PHP code.<br>
<br>
Try just 'mail=%s'</font></tt>
<br>
<br><tt><font size=2>Tried this, no joy.<br>
<br>
>
user_scope
=> 'sub',
<br>
>
}, <br>
>
}, <br>
> }, <br>
> }, <br>
> );<br>
> <br>
> They are apparently doing the initial bind with the credentials submitted
by the user, I am getting invalid credentials the way I have it above,
if I change it to anonymous I get a "LDAP Error while searching for
user: No such object". I could use some suggestions. <br>
<br>
You can turn on LDAP debugging and get a print out of what is actually
going to <=> from the LDAP server, which would help determine which
query specifically is failing..</font></tt>
<br>
<br><tt><font size=2>I cannot find anything out there on turning on LDAP
debugging? Strangely, if I out my username and password in the bind fields
it gives me Invalid credentials. I authenticate through this ldap server
many times a day, so I'm almost sure it's some setting that is wrong. <br>
<br>
Cheers<br>
t0m<br>
<br>
<br>
_______________________________________________<br>
List: Catalyst@lists.scsys.co.uk<br>
Listinfo: </font></tt><a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst"><tt><font size=2>http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</font></tt></a><tt><font size=2><br>
Searchable archive: </font></tt><a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/"><tt><font size=2>http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</font></tt></a><tt><font size=2><br>
Dev site: </font></tt><a href=http://dev.catalyst.perl.org/><tt><font size=2>http://dev.catalyst.perl.org/</font></tt></a><tt><font size=2><br>
<br>
</font></tt>
<br>
<br>