1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Polish Authentication Factors

Issue gh-17933
This commit is contained in:
Josh Cummings
2025-09-19 11:31:08 -06:00
parent 758b35df9c
commit 6e7a181eac
10 changed files with 63 additions and 12 deletions
@@ -16,8 +16,8 @@
package org.springframework.security.ldap.authentication;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashSet;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -104,7 +104,7 @@ public abstract class AbstractLdapAuthenticationProvider implements Authenticati
UserDetails user) {
Object password = this.useAuthenticationRequestCredentials ? authentication.getCredentials()
: user.getPassword();
Collection<GrantedAuthority> authorities = new ArrayList<>(
Collection<GrantedAuthority> authorities = new LinkedHashSet<>(
this.authoritiesMapper.mapAuthorities(user.getAuthorities()));
authorities.add(new SimpleGrantedAuthority(AUTHORITY));
UsernamePasswordAuthenticationToken result = UsernamePasswordAuthenticationToken.authenticated(user, password,