user6023611
user6023611

Reputation:

Understanding meaning of filter in spring ldap

.userSearchBase("ou=people")
.userSearchFilter("(uid={0})")
.groupSearchBase("ou=groups")
.groupSearchFilter("member={0}")

Could anyone explain me what does it mean these filter ?
Whats the difference between base and search filter ? Moreover, whoat does it mean member={0} ?

Upvotes: 6

Views: 6266

Answers (1)

Navoneel Talukdar
Navoneel Talukdar

Reputation: 4608

As per documentation

public LdapAuthenticationProviderConfigurer<B> userSearchBase(String userSearchBase)

Search base for user searches. Defaults to "". Only used with userSearchFilter(String). Parameters: userSearchBase - search base for user searches Returns: the LdapAuthenticationProviderConfigurer for further customizations

user-search-base is used to point to the base path where to find user information.

public LdapAuthenticationProviderConfigurer<B> userSearchFilter(String userSearchFilter)

The LDAP filter used to search for users (optional). For example "(uid={0})". The substituted parameter is the user's login name. Parameters: userSearchFilter - the LDAP filter used to search for users Returns: the LdapAuthenticationProviderConfigurer for further customizations

user-search-filter is the attribute name that contains the user name.

public LdapAuthenticationProviderConfigurer<B> groupSearchBase(String groupSearchBase)

The search base for group membership searches. Defaults to "". Parameters: groupSearchBase - Returns: the LdapAuthenticationProviderConfigurer for further customizations

So group-search-base is the base path where to find role information.

public LdapAuthenticationProviderConfigurer<B> groupSearchFilter(String groupSearchFilter)

The LDAP filter to search for groups. Defaults to "(uniqueMember={0})". The substituted parameter is the DN of the user. Parameters: groupSearchFilter - the LDAP filter to search for groups Returns: the LdapAuthenticationProviderConfigurer for further customizations

So group-search-filter is the attribute name that contains the full dn(distinguished name) of a user.

Upvotes: 4

Related Questions