Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keycloak LDAP integration: using of Custom User LDAP Filter to filter by group

Tags:

ldap

keycloak

I am trying to integrate LDAP Active Directory with Keycloak. I have been able to synchronize LDAP users using Custom User LDAP Filter that filters by LDAP attributes - (theAttribute=theValue). Is there a way/syntax to filter by groups? For example, say I have Active Directory group "My Group" and I want to synchronize to Keycloak only users in that group. What would be the search Custom User LDAP Filter?

like image 200
Jacobs2000 Avatar asked Jun 17 '18 08:06

Jacobs2000


1 Answers

How about memberOf? For example:

(&(objectCategory=Person)(sAMAccountName=*)(theAttribute=theValue)(memberOf=cn=My Group,dc=example,dc=com))

Please refer to RFC2254 "The String Representation of LDAP Search Filters" more details:

like image 174
Kohei TAMURA Avatar answered Sep 28 '22 14:09

Kohei TAMURA