simple example to search for username #428
Comments
Here is a Nodejs example searching Active Directory by userPrincipalName for a user and it console logs their name attribute.
|
Sorry to revive a rather old post, but can someone adjust this to get a list of groups the user is a member of? |
@AlistairHardy It's in the entry.object on the searchEntry event. I believe the groups were in value memberOf inside the entry object. You can see everything if you console.log(entry.object) |
I believe this has been sufficiently answered. If you are still having issues, feel free to re-open. |
If the search can't find a user, no error returns to me |
If no data is found it won't throw an error, since the absence of data is a valid response for LDAP. If you want it to throw an error when there is no user found you'll need to check the response and throw manually when there is no data. Think of it like searching a database. |
@tastypackets How can i verify if the response not found data? |
it's not called the searchEntry event, do you have any idea why please ? (I used your code above) |
Isn't there a problem if the search is performed before the bind has returned? Bind being asynchronous... |
hey , if you want to verify if user is found or not |
Please include a minimal reproducible example |
Sorry for the newb question - I see how to create an ldap client, that is all well and good, but I am looking for an example of how to search for a particular user's information in LDAP.
I know that the language of LDAP is pretty universal, but I am looking for a good example of how to do this with LDAPjs.
thanks
The text was updated successfully, but these errors were encountered: