I am currently using LDAP JS for Authentication in Angular JS app and everything works perfectly fine.
I am now building a new view and the requirement I have is this:
-I have text box in which admin will write may be a few letters of a user id present in LDAP. -I want to show app matching ID present in LDAP on a typeahead/suggestions. I know how typeahead works so that's not an issue. The issue is how can I pass a rejex or pattern matching kind of a thing for 'uid' in search() method.
My sample code is here:
function GetAllLDAPUser(dnFilter, res) {
client.search('uid=WHAT-PATTERN-CAN-I-PASS-HERE' + dnFilter, opts, function (err, result) {
result.on('searchEntry', function (entry) {
// I usually read entry.object or entry.raw here , that works
});
result.on('end', function (result) {
.. .. . ..
});
}
So the question is what should I pass in place of WHAT-PATTERN-CAN-I-PASS-HERE
Results : suppose i type 'an' the typeahead will show all user id starting with 'an' like 'ana', 'anamon','analisa' etc
Please let me know if someone has done something similar or have any idea about it. Thanks.
Aucun commentaire:
Enregistrer un commentaire