Skip to content

Commit

Permalink
EPMRPP-94013 || Not possible to create LDAP integration with any enco…
Browse files Browse the repository at this point in the history
…der type
  • Loading branch information
APiankouski committed Aug 27, 2024
1 parent ae07128 commit 3624528
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,21 @@ protected AuthenticationProvider getDelegate() {
LdapParameter.GROUP_SEARCH_BASE.getParameter(integration).ifPresent(builder::groupSearchBase);
LdapParameter.USER_SEARCH_FILTER.getParameter(integration).ifPresent(builder::userSearchFilter);

LdapParameter.PASSWORD_ENCODER_TYPE.getParameter(integration).ifPresent(it -> {
//TODO: temporary solution for working with encoded passwords
/* LdapParameter.PASSWORD_ENCODER_TYPE.getParameter(integration).ifPresent(it -> {
LdapAuthenticationProviderConfigurer<AuthenticationManagerBuilder>
.PasswordCompareConfigurer passwordCompareConfigurer = builder.passwordCompare();
LdapParameter.PASSWORD_ATTRIBUTE.getParameter(integration)
.ifPresent(passwordCompareConfigurer::passwordAttribute);
/*
*//*
* DIRTY HACK. If LDAP password has salt, ldaptemplate.compare operation does not work
* since we don't know server's salt.
* To enable local password comparison, we need to provide password encoder from crypto's
* package
* This is why we just wrap old encoder with new one interface
* New encoder cannot be used everywhere since it does not have implementation for LDAP
*/
*//*
final PasswordEncoder delegate = PasswordEncoderFactories.createDelegatingPasswordEncoder();
builder.passwordEncoder(new org.springframework.security.crypto.password.PasswordEncoder() {
Expand All @@ -125,7 +126,7 @@ public boolean matches(CharSequence rawPassword, String encodedPassword) {
return delegate.matches(rawPassword, encodedPassword);
}
});
});
});*/

LdapParameter.USER_DN_PATTERN.getParameter(integration).ifPresent(builder::userDnPatterns);

Expand Down

0 comments on commit 3624528

Please sign in to comment.