【发布时间】:2020-07-18 14:38:17
【问题描述】:
我有一个 ldap 服务器,我想在这个 ldap 上使用 spring security。我的连接配置是:
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// TODO Auto-generated method stub
auth.ldapAuthentication()
.userDnPatterns("OU=*****")
.userSearchFilter("(uid={0})")
.groupSearchBase("OU=*****")
.contextSource()
.root("DC=*****,DC=*****,DC=*****")
.port(389);
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().fullyAuthenticated().and().formLogin();
}
}
但是当我运行我的 spring boot 应用程序时,它会尝试连接 ldap://127.0.0.1:389,我如何访问我的 ldap 服务器?我的 ldap 服务器网址是:LDAP://xxx.com.tr
我的错误是什么?
【问题讨论】:
标签: spring-boot spring-security ldap spring-security-ldap