Changes

stoney core: Search Resource Mapping (REST - LDAP)

2,042 bytes added, 13:06, 25 May 2014
/* People Search (GET) */
== People Search (GET) ==
All the people are stored under the sub tree [[stoney_core:_OpenLDAP_directory_data_organisation#People | ou=people,dc=stoney-cloud,dc=org]]. The actual LDIF of a person is described under [[stoney_core:_OpenLDAP_directory_data_organisation#People_uid_.28per_person.29 | People uid (per Person)]]. The following LDAP attributes must be included in the search:* uid (id)* givenName (givenName)* surname (surname) The following LDAP attributes must be returned:* uid (id)* sstIsActive (isActive)* givenName (givenName)* surname (surname)* organizationName (customerName) or givenName and surname (customerName), the same logic applies as for the customer search* sstBelongsToResellerUID (belongsToResellerID)* sstBelongsToCustomerUID (belongsToCustomerID) === Sequence ===The following sequence describes the people search. ==== Search for the entered string ====We presume, that the string to be searched for is '''sto''' (scope is one, size limit is set to 5):<pre>ldapsearch -H ldaps://ldapm.stoney-cloud.org \ -b "ou=people,dc=stoney-cloud,dc=org" \ -s one \ -D "cn=Manager,dc=stoney-cloud,dc=org" \ -z 5 \ -W -x -LLL \ "(|(uid=*sto*)(givenName=*sto*)(surname=*sto*))" uid sstIsActive givenName surname sstBelongsToResellerUID sstBelongsToCustomerUID sstEmployeeOfUID</pre> The possible answer could look as follows:<pre>dn: uid=4000002,ou=people,dc=stoney-cloud,dc=orguid: 4000002givenName: stoney cloudsn: AdministratorsstIsActive: TRUEsstBelongsToResellerUID: 4000000sstBelongsToCustomerUID: 4000001</pre> ==== Create a second search for each result ====As we are interested, to which customer the person belongs to, we need to execute a second search (scope is base):<pre>ldapsearch -H ldaps://ldapm.stoney-cloud.org \ -b "uid=4000001,ou=customers,dc=stoney-cloud,dc=org" \ -s base \ -D "cn=Manager,dc=stoney-cloud,dc=org" \ -z 5 \ -W -x -LLL \ "(objectclass=*)" organizationName givenName surname</pre> The possible answer could look as follows:<pre>dn: uid=4000001,ou=customers,dc=stoney-cloud,dc=orgo:Customer Ltd.</pre>
SLB, editor, reviewer
3,368
edits