소스 검색

SEC-1223: Added break to bindWithDnLoop when non-null use is returned.

Luke Taylor 16 년 전
부모
커밋
d47abbc35f
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      ldap/src/main/java/org/springframework/security/ldap/authentication/BindAuthenticator.java

+ 4 - 0
ldap/src/main/java/org/springframework/security/ldap/authentication/BindAuthenticator.java

@@ -80,6 +80,10 @@ public class BindAuthenticator extends AbstractLdapAuthenticator {
         // If DN patterns are configured, try authenticating with them directly
         for (String dn : getUserDns(username)) {
             user = bindWithDn(dn, username, password);
+
+            if (user != null) {
+                break;
+            }
         }
 
         // Otherwise use the configured search object to find the user and authenticate with the returned DN.