Skip to content

Commit 3cbcc73

Browse files
committed
Change FilterBasedLdapUserSearch to use LdapClient
Closes: gh-17290 Signed-off-by: Andrey Litvitski <[email protected]>
1 parent 975ca9c commit 3cbcc73

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ldap/src/main/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearch.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
import org.springframework.core.log.LogMessage;
2525
import org.springframework.dao.IncorrectResultSizeDataAccessException;
26-
import org.springframework.ldap.core.ContextSource;
2726
import org.springframework.ldap.core.ContextMapper;
27+
import org.springframework.ldap.core.ContextSource;
2828
import org.springframework.ldap.core.DirContextOperations;
2929
import org.springframework.ldap.core.LdapClient;
3030
import org.springframework.ldap.core.support.BaseLdapPathContextSource;
@@ -102,11 +102,11 @@ public DirContextOperations searchForUser(String username) {
102102
.contextSource(this.contextSource)
103103
.defaultSearchControls(() -> this.searchControls)
104104
.build();
105-
LdapQuery query = LdapQueryBuilder.query().base(this.searchBase).filter(searchFilter, username);
105+
LdapQuery query = LdapQueryBuilder.query().base(this.searchBase).filter(this.searchFilter, username);
106106
try {
107107
DirContextOperations operations = ldapClient.search()
108108
.query(query)
109-
.toObject((ContextMapper<DirContextOperations>) ctx -> (DirContextOperations) ctx);
109+
.toObject((ContextMapper<DirContextOperations>) (ctx) -> (DirContextOperations) ctx);
110110
if (operations == null) {
111111
throw UsernameNotFoundException.fromUsername(username);
112112
}

0 commit comments

Comments
 (0)