active directory

Discussion in 'Python' started by stavenko@gmail.com, Dec 15, 2006.

  1. Guest

    Hello all.
    I'm trying ot get users from Active directory. using python-ldap. We
    have a windows network domain. So I tried this code:

    import ldap
    l = ldap.initialize("ldap://ldap.server")
    l.protocol_version = ldap.VERSION3
    l.simple_bind_s('','')

    for i in l.search_ext_s("CN=Users,dc=ldap,dc=server",
    ldap.SCOPE_SUBTREE, "objectclass=*"):
    print i

    Code prints me nothing...
    Then i tried to change auth string to this:

    l.simple_bind_s(r'CN=myname,CN=Users,DC=ldap,DC=server','')

    Code prints me this:
    ('CN=Users,DC=ces,DC=kamchatka,DC=su', {})

    Then i tried next string :
    l.simple_bind_s(r'CN=myname,CN=Users,DC=ldap,DC=server','mypassword')

    Program raises exception in this case.

    ldap.INVALID_CREDENTIALS: {'info': '80090308: LdapErr: DSID-0C09030B,
    comment: AcceptSecurityContext error, data 525, v893', 'desc': 'Invalid
    credentials'}

    But everything is allright. Credentials and passwords correct, server
    gives me a lot of dnsNodes, dnsZones when i try to search under
    dc=ldap,dc=server.

    And in the same time i can easily connect to AD and get users using
    win32com...
    Help me please to authorise to AD...
     
    , Dec 15, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amol Shambharkar
    Replies:
    1
    Views:
    5,014
  2. Micheal

    Authentication on Active Directory

    Micheal, Jul 1, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    382
    Micheal
    Jul 1, 2003
  3. Michael
    Replies:
    1
    Views:
    428
  4. ejcosta
    Replies:
    2
    Views:
    880
    Eurico Costa
    Oct 8, 2004
  5. carlos seramos
    Replies:
    2
    Views:
    492
    carlos seramos
    Aug 1, 2003
Loading...

Share This Page