Re: ldap or active directory module

2016-09-09 Thread John Gordon
In Robert Clove writes: > I want to find if the particular group exist in my active directory Search on the group's DN, specifying SCOPE_BASE as the search scope. If you get a result, then the group exists, otherwise it doesn't. > also another function to find the user in a particular group

Re: ldap or active directory module

2016-09-09 Thread Shyam Parimal Katti
Sure, have you tried it and failed? I remember using this: https://www.python-ldap.org/docs.html year back and was able to do many operations including lookups. On Fri, Sep 9, 2016 at 5:41 AM, Robert Clove wrote: > Is it possible to find the following things using python ldap or active > direc

Re: Ldap module and base64 oncoding

2013-05-28 Thread Michael Ströder
Joseph L. Casale wrote: > I had some time today, so I attempted to open the ldif files in binary mode > to simply > work with the raw byte strings but the moment the first entry was parsed, > parse() > stumbled on a character in the first entries dict and passed a dn of None for > the last half?

RE: Ldap module and base64 oncoding

2013-05-27 Thread Joseph L. Casale
> Note that all modules in python-ldap up to 2.4.10 including module 'ldif' > expect raw byte strings to be passed as arguments. It seems to me you're > passing a Unicode object in the entry dictionary which will fail in case an > attribute value contains NON-ASCII chars. Yup, I was. > python-lda

Re: Ldap module and base64 oncoding

2013-05-27 Thread Michael Ströder
Joseph L. Casale wrote: > After parsing the data for a user I am simply taking a value from the ldif > file and writing > it back out to another which fails, the value parsed is: > > officestreetaddress:: T3R0by1NZcOfbWVyLVN0cmHDn2UgMQ== > > > File "C:\Python27\lib\site-packages\ldif.py", lin

Re: Ldap module and base64 oncoding

2013-05-26 Thread dieter
"Joseph L. Casale" writes: > ... > After parsing the data for a user I am simply taking a value from the ldif > file and writing > it back out to another which fails, the value parsed is: > > officestreetaddress:: T3R0by1NZcOfbWVyLVN0cmHDn2UgMQ== > > > File "C:\Python27\lib\site-packages\ldif.p

RE: Ldap module and base64 oncoding

2013-05-26 Thread Joseph L. Casale
Hi Michael, > Processing LDIF is one thing, doing LDAP operations another. > > LDIF itself is meant to be ASCII-clean. But each attribute value can carry any > byte sequence (e.g. attribute 'jpegPhoto'). There's no further processing by > module LDIF - it simply returns byte sequences. > > The a

Re: Ldap module and base64 oncoding

2013-05-26 Thread Michael Ströder
Joseph L. Casale wrote: >> I'm not sure what exactly you're asking for. >> Especially "is not being interpreted as a string requiring base64 encoding" >> is >> written without giving the right context. >> >> So I'm just guessing that this might be the usual misunderstandings with use >> of base64

RE: Ldap module and base64 oncoding

2013-05-26 Thread Joseph L. Casale
> I'm not sure what exactly you're asking for. > Especially "is not being interpreted as a string requiring base64 encoding" is > written without giving the right context. > > So I'm just guessing that this might be the usual misunderstandings with use > of base64 in LDIF. Read more about when LDI

Re: Ldap module and base64 oncoding

2013-05-26 Thread Michael Ströder
Joseph L. Casale wrote: >> Can you give an example of the code you have? > > I actually just overrode the regex used by the method in the LDIFWriter class > to be far more broad > about what it interprets as a safe string. Are you sure that you fully understood RFC 2849 before doing this? Which

Re: Ldap module and base64 oncoding

2013-05-26 Thread Michael Ströder
Joseph L. Casale wrote: > I have some data I am working with that is not being interpreted as a string > requiring > base64 encoding when sent to the ldif module for output. > > The base64 string parsed is ZGV0XDMzMTB3YmJccGc= and the raw string is > det\3310wbb\pg. > I'll admit my understanding

RE: Ldap module and base64 oncoding

2013-05-25 Thread Joseph L. Casale
> Can you give an example of the code you have? I actually just overrode the regex used by the method in the LDIFWriter class to be far more broad about what it interprets as a safe string. I really need to properly handle reading, manipulating and writing non ascii data to solve this... Shame

RE: Ldap module and base64 oncoding

2013-05-24 Thread Carlos Nepomuceno
Can you give an example of the code you have? > From: [email protected] > To: [email protected] > Subject: Ldap module and base64 oncoding > Date: Fri, 24 May 2013 21:00:01 + > > I have some data I am working with that is not being interpre

Re: ldap proxy user bind

2012-02-12 Thread Michael Ströder
sajuptpm wrote: Yea i am not totally clear about that Client's Requirement is option to have a ldap proxy user bind to the ldap server if it needs more directory rights than an anonymous bind. option to use a ldap proxy user when searching. As said: there's the proxy authorization control (see

Re: ldap proxy user bind

2012-02-11 Thread sajuptpm
Hi Michael Torrie, Thanks to reply Why we need Twisted here, i did not get it. My understanding is that if ldap_proxy_user = ldap_proxy ldap_proxy_pwd = secret ( set more privileges to this user at ldap server side, for get other users infos) are configured at server side, then allow clients to l

Re: ldap proxy user bind

2012-02-11 Thread Michael Torrie
On 02/11/2012 08:35 PM, Michael Torrie wrote: > On 02/11/2012 02:19 PM, sajuptpm wrote: >> Hi Michael Ströder, >> Thanks for replay >> >> Yea i am not totally clear about that >> >> Client's Requirement is >> option to have a ldap proxy user bind to the ldap server if it needs >> more directory rig

Re: ldap proxy user bind

2012-02-11 Thread Michael Torrie
On 02/11/2012 02:19 PM, sajuptpm wrote: > Hi Michael Ströder, > Thanks for replay > > Yea i am not totally clear about that > > Client's Requirement is > option to have a ldap proxy user bind to the ldap server if it needs > more directory rights than an anonymous bind. > option to use a ldap pro

Re: ldap proxy user bind

2012-02-11 Thread Michael Ströder
sajuptpm wrote: I have developed a LDAP auth system using python-ldap module. Using that i can validate username and password, fetch user and groups info from LDAP directory. Now i want to implement ldap proxy user bind to the ldap server. What do you mean exactly? Are you talking about LDAPv

Re: LDAP: How get all users belongs to a group.

2011-06-25 Thread Michael Ströder
sajuptpm wrote: > results = ldapClient.search_s("cn=My-Group-1,ou=Groups,o=CUST", > ldap.SCOPE_BASE) > > Is this method work for all types of groups (groupOfNames, > posixGroup) ??? Yes, but the member attribute differs. 'member' in entries of object class 'groupOfNames' contains the DN of the m

Re: LDAP: How get all users belongs to a group.

2011-06-25 Thread sajuptpm
results = ldapClient.search_s("cn=My-Group-1,ou=Groups,o=CUST", ldap.SCOPE_BASE) Is this method work for all types of groups (groupOfNames, posixGroup) ??? have to implement user search/fetch separately for each groups ??? -- http://mail.python.org/mailman/listinfo/python-list

Re: LDAP: How get all users belongs to a group.

2011-06-24 Thread John Gordon
In <34110eed-96bc-499f-9a4e-068f2720f...@h12g2000pro.googlegroups.com> sajuptpm writes: > dn: cn=My-Group-1,ou=Groups,o=CUST > member: cn=AJP2203,ou=Internal PCA,o=CUST > member: cn=AZE9632,ou=Internal PCA,o=CUST > member: cn=BTC4979,ou=Internal PCA,o=CUST > * I have group definition in LDAP se

Re: LDAP: How get all users belongs to a group.

2011-06-24 Thread Michael Ströder
sajuptpm wrote: > --- User > > cn=AJP2203,ou=Internal PCA,o=CUST has group memberships > to the following Groups: > groupMembership: cn=My-Group-1,ou=Groups,o=CUST > groupMembership: cn=My-Group-2,u=Groups,o=CUST > groupMembership: cn=My-Group-3,ou=Groups,o=

Re: LDAP: How get all users belongs to a group.

2011-06-24 Thread sajuptpm
--- User cn=AJP2203,ou=Internal PCA,o=CUST has group memberships to the following Groups: groupMembership: cn=My-Group-1,ou=Groups,o=CUST groupMembership: cn=My-Group-2,u=Groups,o=CUST groupMembership: cn=My-Group-3,ou=Groups,o=CUST

Re: LDAP: How get all users belongs to a group.

2011-06-24 Thread sajuptpm
I am using Openldap (openldap 2.3.43-12.el5_5.2 and openldap.i386 0:2.3.43_2.2.29-12.el5_6.7) -- http://mail.python.org/mailman/listinfo/python-list

Re: LDAP: How get all users belongs to a group.

2011-06-24 Thread sajuptpm
Hi, Thanks for reply. dn: cn=My-Group-1, ou=Groups, o=CUST equivalentToMe: cn=TDS7034,ou=Internal PCA,o=CUST objectClass: groupOfNames < objectClass: top objectClass: swarePointers ACL: 2#entry#[Root]#member cn: My-Group-1 member: cn=AJP2203,ou=Internal PCA,o=CUST member: cn=AZE9632,o

Re: LDAP: How get all users belongs to a group.

2011-06-24 Thread Michael Ströder
sajuptpm wrote: > How get all users belongs to a group using python ldap module. There are several ways of storing grouping information in a LDAP server. I assume the groups are normal group entries of object class 'groupOfNames' which is most commonly used. Such an entry has the attribute 'membe

Re: LDAP: How get all users belongs to a group.

2011-06-23 Thread Ken Watford
On Thu, Jun 23, 2011 at 9:14 AM, sajuptpm wrote: > Hi, > How get all users belongs to a group using python ldap module. Depends on what you mean by "users" and "group", what information you already have, and what information you want to get. I'll assume you mean posix accounts and groups, and tha

Re: ldap package question

2009-03-17 Thread Michael Ströder
John Gordon wrote: > I'm using the ldap package to connect to an ldap server and run a query. > Very simple code, along these lines: > > con = ldap.initialize(uri) > con.simple_bind_s(user, password) > results = con.search_s(group, ldap.SCOPE_SUBTREE, filter, attrs) > for r in results: >

Re: Ldap Extended Operation python

2009-01-26 Thread Michael Ströder
Benny Fallica wrote: > Hello there, > > what would be the python implementation for this line in Java: > > > java.util.Hashtable environment = LdapHelper.getEnvironment(url, true); > LdapContext ldapContext = new InitialLdapContext(environment, null); > Response resp = (Response) ldapContext.ext

Re: ldap

2008-04-07 Thread Michael Ströder
[EMAIL PROTECTED] wrote: > Searching on the web I know that exists PythonLdap, but I dont'know if > this is best choise or not. http://python-ldap.sf.net is the most complete implementation I know of. (Being the maintainer I might be biased.) It has the caveat of depending on the OpenLDAP client

Re: ldap

2008-04-07 Thread David Harrison
On 07/04/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > sorry, i'm new with Python. > I must do interaction beetween Python and Ldap, and I don't know how > do this. > Searching on the web I know that exists PythonLdap, but I dont'know if > this is best choise or not. > > Thank's > > -

Re: ldap

2008-04-07 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > sorry, i'm new with Python. > I must do interaction beetween Python and Ldap, and I don't know how > do this. > Searching on the web I know that exists PythonLdap, but I dont'know if > this is best choise or not. Who cares? Use it, and see if it's good enough for your

Re: LDAP/LDIF Parsing

2007-02-05 Thread Michael Ströder
Bruno Desthuilliers wrote: > > If you know which attributes are supposed to be multivalued in your > specific application, then it's time to write a more serious, > application-specific wrapper. ldap.schema can be used to find that out. Ciao, Michael. -- http://mail.python.org/mailman/listinfo/

Re: LDAP/LDIF Parsing

2007-02-03 Thread Bruno Desthuilliers
Hallvard B Furuseth a écrit : > Bruno Desthuilliers writes: > >>Hallvard B Furuseth a écrit : >> else: # all LDAP attribs are multivalued by default, # even when the schema says they are monovalued if len(data) == 1: return data[0]

Re: LDAP/LDIF Parsing

2007-02-02 Thread Hallvard B Furuseth
Bruno Desthuilliers writes: >Hallvard B Furuseth a écrit : >>> else: >>># all LDAP attribs are multivalued by default, >>># even when the schema says they are monovalued >>>if len(data) == 1: >>> return data[0] >>>else: >>> return data[:] >>

Re: LDAP/LDIF Parsing

2007-02-02 Thread Michael Ströder
Cruelemort wrote: > I was wondering the best way to do this? I have installed and used the > python-ldap libraries and these allow me to access and search the > server, but the searches always return a horrible nesting of lists, > tuples and dictionaries, below is an example of returning just one >

Re: LDAP/LDIF Parsing

2007-02-02 Thread Bruno Desthuilliers
Hallvard B Furuseth a écrit : > Bruno Desthuilliers writes: >> class LdapObject(object): >>(...) >>def __getattr__(self, name): >> try: >>data = self._record[name] >> except KeyError: >>raise AttributeError( >> "object %s has no attribute %s" % (self, name

Re: LDAP/LDIF Parsing

2007-02-02 Thread Hallvard B Furuseth
Bruno Desthuilliers writes: > class LdapObject(object): >(...) >def __getattr__(self, name): > try: >data = self._record[name] > except KeyError: >raise AttributeError( > "object %s has no attribute %s" % (self, name) > ) Note that LDAP attribute

Re: LDAP/LDIF Parsing

2007-02-02 Thread Cruelemort
On Feb 1, 11:08 pm, "aspineux" <[EMAIL PROTECTED]> wrote: > The tree hierarchy is defined by the DN of each object, the types of > the object is specified by its objectClass. > Just collect all items (or do it dynamically by tunning the scope and > the base of your search request) > > On 1 fév, 18:

Re: LDAP/LDIF Parsing

2007-02-01 Thread aspineux
The tree hierarchy is defined by the DN of each object, the types of the object is specified by its objectClass. Just collect all items (or do it dynamically by tunning the scope and the base of your search request) On 1 fév, 18:22, "Cruelemort" <[EMAIL PROTECTED]> wrote: > All, > > I am hoping

Re: LDAP/LDIF Parsing

2007-02-01 Thread Bruno Desthuilliers
Cruelemort a écrit : > All, > > I am hoping someone would be able to help me with a problem. I have an > LDAP server running on a linux box, this LDAP server contains a > telephone list in various groupings, the ldif file of which is - > (snip) > > I am creating a python client program that will

Re: LDAP/LDIF Parsing

2007-02-01 Thread Diez B. Roggisch
> > I was wondering the best way to do this? I have installed and used the > python-ldap libraries and these allow me to access and search the > server, but the searches always return a horrible nesting of lists, > tuples and dictionaries, below is an example of returning just one > record - > >

Re: ldap usage

2006-03-31 Thread Michael Ströder
Jed Parsons wrote: > >> Which LDAP server are you using? You can switch off this behaviour >> with OpenLDAP. See man 5 slapd.conf, allow . > > I don't have anything other than user access. Good to know about this > feature, though. In case you're programming for different LDAP servers it's good

Re: ldap usage

2006-03-30 Thread Jed Parsons
> Which LDAP server are you using? You can switch off this behaviour > with OpenLDAP. See man 5 slapd.conf, allow . I don't have anything other than user access. Good to know about this feature, though. You've been very helpful - I really appreciate it. Can you recommend any favorite books

Re: ldap usage

2006-03-30 Thread Michael Ströder
Jed Parsons wrote: > > As an addendum, I discovered one little gotcha, namely that this: > > l.bind_s(username, password, ldap.AUTH_SIMPLE) > > throws an ldap.INVALID_CREDENTIALS error if the password contains the > wrong text, but works if the password is empty. I guess this is > tantamoun

Re: ldap usage

2006-03-29 Thread Jed Parsons
Hi, Michael, Thanks very much for your response. I think I can work it out now. >> authenticated = False > ^^^ > Identiation is wrong here. Yes, sorry about that - doesn't always work on this email client :( As an addendum, I discovered one little gotcha, namely that this:

Re: ldap usage

2006-03-29 Thread Michael Ströder
Jed Parsons wrote: > > import ldap > l = ldap.open('our.ldap.server') > try: > l.bind_s(username, password, ldap.AUTH_SIMPLE) > authenticated = True > except: > authenticated = False ^^^ Identiation is wrong here. Also I'd recommend to catch the ldap.LDAP

RE: ldap usage

2006-03-28 Thread Jed Parsons
Title: RE: ldap usage Looks like the top of my message got garbled I was trying to say that I'm using ldap for the first time, trying to write a script that authenticates a user against our ldap server.  etc.  The rest came through. Hope that makes more sense now :) j -Ori

Re: ldap passwd need help

2006-01-19 Thread Michael Ströder
Sells, Fred wrote: > > I've got the ldap stuff working for groups, but now I'm trying to use it to > change a user password. I get a return of 2 and no error messages but it > does not change ldap. Could you please post a complete Python traceback? If you mean "2" being the LDAP error code this