Java LDAP - Determine if user in a given group?

后端 未结 10 809
时光取名叫无心
时光取名叫无心 2020-12-12 20:18

We logon users to Active Directory via LDAP using the Java LDAP API. We want to enhance our logon functionality to further check if the user is in a given AD group. Does a

10条回答
  •  臣服心动
    2020-12-12 21:07

    I can't give you a working code using java naming ldap. I used Spring LDAP, and the way you do it: Get the User object, do a search on the username something like sAMAccountName=USERNAME

    After you get the object you retreive the property memberOf -> this will be a list and check for a specific one in Java.

    That is the only way I could think of.

提交回复
热议问题