<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 &lt;bobtfish@bobtfish.net&gt;</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 &lt;catalyst@lists.scsys.co.uk&gt;</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>
&gt; 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.
&nbsp;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>
&gt; <br>
&gt; //Connect to ldap server <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; $ds=ldap_connect(&quot;xxx.xxx.xxx.xxx&quot;);
<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; if ($ds) { <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; //Get ID for intranet user <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sr=ldap_search($ds,
&quot;ou=ldap.server, o=domain.com&quot;, &quot;mail=$username&quot;);
<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $info = ldap_get_entries($ds,
$sr); <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for ($i=0;
$i&lt;$info[&quot;count&quot;]; $i++) { <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; $uid=$info[$i][&quot;dn&quot;]; <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } <br>
&gt; <br>
<br>
&lt;snip&gt;<br>
<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; credential =&gt; { <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; class
=&gt; 'Password', <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; password_field
=&gt; 'password', <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; password_type
=&gt; 'self_check', <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<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>
&gt; &nbsp;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; store =&gt; { <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; binddn
&nbsp;=&gt; &quot;username&quot;, <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;bindpw &nbsp;=&gt; &quot;password&quot;,
<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; class
=&gt; 'LDAP', <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ldap_server
=&gt; '9.17.186.253', <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ldap_server_options
=&gt; { timeout =&gt; 30 }, <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; user_basedn
=&gt; 'o=domain, o=com', <br>
<br>
Original code has:<br>
&gt; &quot;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>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; user_field
=&gt; 'mail', <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; user_filter
=&gt; '(&amp;(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>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; user_scope
=&gt; 'sub', &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }, <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; }, <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }, <br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; }, <br>
&gt; );<br>
&gt; <br>
&gt; 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 &quot;LDAP Error while searching for
user: No such object&quot;. &nbsp;I could use some suggestions. <br>
<br>
You can turn on LDAP debugging and get a print out of what is actually
going to &lt;=&gt; 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>