spring - LDAP 自定义 AuthnticationProvider Spring
问题描述
我必须根据我的 LDAP 验证浏览器凭据。但是浏览器中给出的用户名/密码必须用于连接 LDAP,它不是固定的用户 DN 和密码。身份验证后,我只从 LDAP 获取角色。我看到了各种建议 AuthenticationProvider.authenticate 的例子。但我想知道我需要使用什么方法来验证或搜索用户,这将返回我的用户对象和角色。请指导。这有助于我Spring Security 自定义 ldapAuthenticationProvider + 自定义 ldapAuthoritiesPopulator,但我需要知道如何实现这里提到的 authenticateByLdap 以便它返回 DirContextOperations
解决方案
推荐阅读
- android - 如何测试在 ios 和 android 上禁用自动备份?
- junit - 寻找具有嵌入式驱动程序的存储库单元测试的 Neo4j 示例
- coldfusion - 使用 CFSavecontent 生成 Excel 表格不会将图像写入 Excel 文件
- angular - 如何在具有静态变量的服务上使用 Jasmine 间谍?
- python - 在 OpenCV 中自动拍照
- javascript - 如何将 JSON 对象数组与作业 ID 一起插入到 MongoDB 集合中
- ocaml - 如何将 Ocaml 升级到最新版本以支持 Coq 中的 QuickChick?
- c# - Blazor HttpClient 卡在 GetAsync 中
- oracle - 安装 Oracle XE 18.4 后 Fedora Linux 无法启动
- nativescript - 仅允许 TextField 中的数值