<div><br></div>you can utilize the ldapadapter, and ldappas packages to integrate in ldap authentication..<div><br></div><div><div>ldap = ldapadapter.utility.LDAPAdapter(&#39;<a href="http://foobar.org">foobar.org</a>&#39;,</div>
<div>                                        389,</div><div>                                        bindDN=&#39;cn=pftreadonly,cn=users,dc=foobar,dc=org&#39;,</div><div>                                        bindPassword=&#39;nowayhome&#39;)</div>
<div><br></div><div>you&#39;ll register the connection via zcml</div><div><br></div><div><div>  &lt;!-- Setup LDAP Connection --&gt;</div><div>  &lt;utility</div><div>     name=&quot;my-ldap&quot;</div><div>     component=&quot;.auth.ldap&quot;/&gt;</div>
<div><br></div><div>and then setup an auth utility to utilize it, if you need to apply zope groups its best to subclass the authentication utility, for example here&#39;s a subclasses authentication utility that provides extra roles based on a field in the ldap user.</div>
<div><br></div><div><div>class LDAPAuthentication( ldappas.authentication.LDAPAuthentication ):</div><div><br></div><div>    type_role_map = {</div><div>        &#39;Company Employee&#39; : &#39;app.Contributor&#39;,</div>
<div>        None : &#39;app.Member&#39; # default</div><div>        }</div><div><br></div><div>    def getInfoFromEntry( self, dn, entry ):</div><div>        current_user_role.user_id = entry[self.loginAttribute][0]</div>
<div>        user_type = entry[&#39;usertype&#39;][0]</div><div>        current_user_role.user_role = self.type_role_map.get( user_type, self.type_role_map.get( None ) )</div><div>        return super( LDAPAuthentication, self).getInfoFromEntry( dn, entry )</div>
<div><br></div><div>and then set up an instance to be used.</div></div></div><div><br></div><div>authService = LDAPAuthentication()</div><div><br></div><div>authService.adapterName = &#39;my-ldap&#39;</div><div>authService.titleAttribute = &#39;cn&#39;</div>
<div>authService.idAttribute = &#39;sAMAccountName&#39;</div><div>authService.loginAttribute = &#39;sAMAccountName&#39;</div><div>authService.principalIdPrefix = &#39;ldap.&#39;</div><div>authService.searchBase = &#39;ou=People,dc=foobar,dc=org&#39;</div>
<div>authService.searchScope = &#39;sub&#39;</div><div>authService.groupSearchBase = &#39;ou=People,dc=foobar,dc=org&#39;</div><div>authService.groupSearchScope = &#39;sub&#39;</div><div><br></div><div>and register it in zcml as an auth service</div>
<div><br></div><div><div>  &lt;!-- LDAP Authentication Utility --&gt;</div><div>  &lt;utility</div><div>     provides=&quot;zope.app.authentication.interfaces.IAuthenticatorPlugin&quot;</div><div>     component=&quot;.auth.authService&quot;</div>
<div>     name=&quot;ldap-auth&quot;/&gt;</div><div><br></div><div>hope that helps,</div><div><br></div><div>kapil</div></div><br><div class="gmail_quote">On Fri, Aug 7, 2009 at 8:46 AM, Jeroen Michiel <span dir="ltr">&lt;<a href="mailto:jmichiel@yahoo.com">jmichiel@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Sorry for bringing up an old topic, but this looks like exactly what I would<br>
need.<br>
Is there such a package available somewhere?<br>
<br>
<br>
Vinny-5 wrote:<br>
&gt;<br>
&gt; On Fri, 16 Feb 2007 09:03:29 -0400<br>
&gt; &quot;Alec Munro&quot; &lt;<a href="mailto:alecmunro@gmail.com">alecmunro@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; [snip]<br>
&gt;&gt;<br>
&gt;&gt; Thanks to all your excellent advice, I have gone ahead and extended<br>
&gt;&gt; the existing Group folder to automatically import and periodically<br>
&gt;&gt; synchronize it&#39;s groups with an LDAP directory. The functionality is<br>
&gt;&gt; currently a bit crude, but it gets the job done. I&#39;m talking to my<br>
&gt;&gt; employer about open sourcing it, would anyone here be interested in<br>
&gt;&gt; it?<br>
&gt;&gt;<br>
&gt;&gt; Alec<br>
&gt;<br>
&gt; +1<br>
&gt;<br>
&gt; I, for one, would probably learn something useful from the code, if<br>
&gt; you decide to release it.  Thanks in advance if that is the case.<br>
&gt;<br>
&gt; Vinny<br>
&gt; _______________________________________________<br>
&gt; Zope3-users mailing list<br>
&gt; <a href="mailto:Zope3-users@zope.org">Zope3-users@zope.org</a><br>
&gt; <a href="http://mail.zope.org/mailman/listinfo/zope3-users" target="_blank">http://mail.zope.org/mailman/listinfo/zope3-users</a><br>
&gt;<br>
&gt;<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://www.nabble.com/Applying-permissions-to-users-from-LDAP-tp8887767p24864213.html" target="_blank">http://www.nabble.com/Applying-permissions-to-users-from-LDAP-tp8887767p24864213.html</a><br>

Sent from the Zope3 - users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
Zope3-users mailing list<br>
<a href="mailto:Zope3-users@zope.org">Zope3-users@zope.org</a><br>
<a href="http://mail.zope.org/mailman/listinfo/zope3-users" target="_blank">http://mail.zope.org/mailman/listinfo/zope3-users</a><br>
</font></blockquote></div><br></div>