小编Ste*_*lon的帖子

用于LDAP的Spring Security Java配置

如何设置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)

spring ldap spring-security

4
推荐指数
1
解决办法
6397
查看次数

标签 统计

ldap ×1

spring ×1

spring-security ×1