Here is what I have used (from the terraform resource)
url = “ldap://:389”
deny_null_bind = true
userattr = “samaccountName”
upndomain = “”
discoverdn = false
binddn = “CN=vault_svc,”
userdn = “OU=<user directory, full DN>”
bindpass = “<vault_svc password>”
groupfilter = “(&(objectClass=person)(sAMAccountName={{.Username}}))”
groupattr = “memberOf”
groupdn = “OU=”
after this was linked I created a LDAP auth backend group (that was what the groupdn searches under I believe.
I set the Ldap groupname and then assigned policies. That allowed the LDAP group token whatever policies you wish.
I think I found the solution, I added the userfilter in the auth/ldap/config and configured it like this :
userfilter=“(&(objectClass=user)({{.UserAttr}}={{.Username}})(memberOf=cn=MySelectedGroup,cn=Users,dc=test,dc=com))”
So change the “memberOf=” at the end so that it matches your ldap group.