【发布时间】:2021-11-05 03:16:25
【问题描述】:
当我研究使用 Spring Security 实现 LDAP 身份验证时,我看到组搜索和用户搜索过滤器通常使用 {0} 实现。如:
public void configure(AuthenticationManagerBuilder auth) throws Exception {
auth
.ldapAuthentication()
.userDnPatterns("uid={0},ou=people")
.groupSearchBase("ou=groups")
.contextSource()
.url("ldap://localhost:8389/dc=springframework,dc=org")
.and()
.passwordCompare()
.passwordEncoder(new BCryptPasswordEncoder())
.passwordAttribute("userPassword");
}
In a site,我看到那是用来表示“相等”的标记。但是,这不是很清楚,我在正式文档中找不到关于此的信息。
这些花括号真正突出的是什么,它们可以有任何其他值而不是 0 吗?
【问题讨论】:
标签: spring authentication spring-security ldap spring-security-ldap