I have a simple LDAP PasswordStore component I wrote for the
AccountManager plugin.  I can't give you the whole code, as it
contains some specific customizations, but it's a start:

import ldap
from acct_mgr.api import IPasswordStore
class LdapPasswordStore(Component):
    implements(IPasswordStore)

    # Load ldap_server, ldap_domain from a config file

    def check_password(self, user, password):
        ldapurl = "ldap://%s:3268"; % ldap_server
        username = "%s\\%s" % (ldap_domain, user)
        connection = ldap.initialize(ldapurl)
        try:
            connection.simple_bind_s(username, password)
        except:
            return False
        return True

You can put something like that into a file and add it to
accountmanager when you make the egg file for it.  Then set
password_store = LdapPasswordStore under [account-manager] in your
trac.ini.

This also depends on the python LDAP package:
http://python-ldap.sourceforge.net/

On 4/20/07, Rainer Sokoll <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I want to use a form based login instead of HTTP authentication (in
> fact, I want to have the logout button working)
> From what I've learend, this should be possible with AccountManager.
> All my users are stored in an LDAP directory (MS-ADS, in my case). LDAP
> authentication works fine from apache. But I cannot bind as an anonymous
> user, I have to apply a real username/pw combination.
> In apache:
>     AuthLDAPBindDN foo
>     AuthLDAPBindPassword bar
> Does that mean that I cannot use AccountManager in my environment?
>
> Rainer
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to