首页 > 解决方案 > LDAP 自定义 AuthnticationProvider Spring

问题描述

我必须根据我的 LDAP 验证浏览器凭据。但是浏览器中给出的用户名/密码必须用于连接 LDAP,它不是固定的用户 DN 和密码。身份验证后,我只从 LDAP 获取角色。我看到了各种建议 AuthenticationProvider.authenticate 的例子。但我想知道我需要使用什么方法来验证或搜索用户,这将返回我的用户对象和角色。请指导。这有助于我Spring Security 自定义 ldapAuthenticationProvider + 自定义 ldapAuthoritiesPopulator,但我需要知道如何实现这里提到的 authenticateByLdap 以便它返回 DirContextOperations

标签: springspring-security-ldap

解决方案


推荐阅读