ソースを参照

Updated SpringSecurityLdapTemplate to include base LDAP context in returned DirContextAdapter entry to make sure the result gives a correct value for getNameInNamespace(). This is necessary when a search is used to obtain entries to pass to DefaultLdapAuthoritiesPopulator, for example.

Luke Taylor 17 年 前
コミット
544df3ea09

+ 2 - 1
core/src/main/java/org/springframework/security/ldap/SpringSecurityLdapTemplate.java

@@ -204,7 +204,8 @@ public class SpringSecurityLdapTemplate extends org.springframework.ldap.core.Ld
                         dn.append(base);
                     }
 
-                    return new DirContextAdapter(searchResult.getAttributes(), new DistinguishedName(dn.toString()));
+                    return new DirContextAdapter(searchResult.getAttributes(),
+                            new DistinguishedName(dn.toString()), new DistinguishedName(ctx.getNameInNamespace()));
                 }
             });
     }