-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Change ActiveDirectoryLdapAuthenticationProvider to use LdapClient
#18627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| LdapClient ldapClient = LdapClient.builder() | ||
| .contextSource(contextSource) | ||
| .defaultSearchControls(() -> searchControls) | ||
| .ignorePartialResultException(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SpringSecurityLdapTemplate#searchForSingleEntryInternal behavior also ignores partial result exceptions.
| } | ||
| catch (org.springframework.ldap.NamingException ex) { | ||
| throw badCredentials(ex); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what you should do, otherwise the tests will fail.
| given(this.ctx.search(any(Name.class), eq(customSearchFilter), any(Object[].class), any(SearchControls.class))) | ||
| given(this.ctx.search(any(Name.class), any(String.class), any(SearchControls.class))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure whether this is a breaking change or not. Because when switching to LdapClient, we don't accept any(Object[].class) as the fourth argument, so we don't need to mock it.
|
I don't quite understand whether this is breaking Change or not, please take a look at #18627 (comment) |
Replaces SpringSecurityLdapTemplate with LdapClient for user search operations. Closes: spring-projectsgh-17291 Signed-off-by: Andrey Litvitski <[email protected]>
|
FYI I rebased based off origin/main |
Replaces
SpringSecurityLdapTemplatewithLdapClientfor user search operations.Closes: gh-17291