【发布时间】:2017-04-12 07:48:27
【问题描述】:
我正在尝试使用 Spring Boot 测试 Active Directory 身份验证。我有一个 Active Directory 正在工作,我可以通过 LDAP 浏览器为我的管理员用户使用该用户 dn 访问它:
CN=Administrator,CN=Users,DC=contoso,DC=com
我想在我的应用程序中使用 LDAP 作为身份验证管理器。文档中的简单示例如下:
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.ldapAuthentication()
.userDnPatterns("CN={0},CN=Users,DC=contoso,DC=com")
.groupSearchBase("ou=groups")
.contextSource()
.managerDn("CN=Administrator,CN=Users,DC=contoso,DC=com")
.managerPassword("myadminpassword")
.url("ldap://192.168.1.1:389");
}
首先,我应该提供管理员密码来连接 Active Directory 这样的登录吗?
其次,我应该提供 groupSearchBase 和 userDnPatterns 以及如何提供?
【问题讨论】:
标签: spring authentication spring-boot active-directory ldap