如何设置spring安全性LDAP配置的URL?有很多基于xml的示例,但我找不到一个java配置示例来复制下面的xml行.我假设它是在以下java代码块中配置的,从弹簧指南中获取使用嵌入式ldap,但我们如何设置外部URL?
<ldap-server id="ldapServer" url="ldap://example.com:PORT/dc=example,dc=com" />
Run Code Online (Sandbox Code Playgroud)
@Override
public void init(AuthenticationManagerBuilder auth) throws Exception {
auth.ldapAuthentication()
.userDnPatterns("uid={0},ou=people")
.groupSearchBase("ou=groups")
.contextSource()
.ldif("classpath:test-server.ldif");
}
Run Code Online (Sandbox Code Playgroud)