[Date Prev][Date Next] [Chronological] [Thread] [Top]

´ð¸´: Object uniqueness



Of course you could use UID to do so.  Seems you don't understand LDAP that well. Only one thing to uniquely identify a entry in a LDAP tree is the dn, also the full path from the root to the final leaf. for example, take a look at following graph:

               o=linux.com
            /         \
          /            \
       ou=tech    ou=hr
       /                  \   
      /                    \
    cn=John        cn=John


This is fine. because it's the DN, which you use ldap_add to add is the unique identifer. say, cn=john,ou=tech,o=linux.com. this whole string uniquely identify the user John who working in the tech department. NOT just the cn. As LDAP in fact is a object database or object tree. the PATH is the key.

So, for your question, Yes, you could use UID as your "primary key"(But, don't use the primary key , no such a concept in LDAP).  Since the predefined class "person "( in slapd.oc.conf) has several contribute,such as "cn","sn","telephonenumber". YOu could use any of them to take the place of "cn" used here. I.e, you could use a dn like "telephone=1234,ou=hr,o=linux.com" to identify a user in the LDAP database.


Regards,

Vincent
-----????-----
???: owner-openldap-software@OpenLDAP.org [mailto:owner-openldap-software@OpenLDAP.org]?? Hugo Monteiro
????: 2000?7?5? 20:09
???: openldap-software@OpenLDAP.org
??: Object uniqueness


    Right now i'm using cn as unique attribute on my dn (in combination
with O and OU). I was wondering if there is a way of making objects
unique by using another attribute, .i.e. i would like to use UID as my
"primary key". Is that possible, and if so what would be the right way
of implementing it?.

Thanks in advance.

Hugo.

--
---------------------------------------------------------------------------
| Hugo Monteiro                      | Móvel: +351-966 386 090            |
| Serviço de Informática da          | Fixo : +351-212 948 300 Ext.1 0703 |
| Faculdade de Ciências e Tecnologia |                             1 5306 |
| Universidade Nova de Lisboa        |                                    |
| 2825-114 Monte Caparica            | Email: hugo.monteiro@fct.unl.pt    |
---------------------------------------------------------------------------