spring-security - 基于 SAML 的 SSO 用于身份验证和 LDAP 用于授权 - Spring Boot Security
问题描述
将 Gsuite 与 Cloud Identity 专业版结合使用
a) 将 GSuite 初始化为 iDP 作为 SSO 的 SAML 应用程序 b) 用于读取用户信息和组信息以进行授权的安全 LDAP 客户端。
真的很困惑如何将 LDAP 客户端(作为授权提供者)与 SAML SSO(身份验证提供者)一起注册。
解决方案
使用 application.properties/application.yml 设置属性
spring:
ldap:
urls: ldap://<address>:<port>
base: <baseDN>
username: <userDN>
password: <password>
pooled: true
使用配置类定义具有上述属性的 bean
@Bean
public LdapContextSource contextSource() {
LdapContextSource ctx = new LdapContextSource();
ctx.setUrl(urls);
ctx.setUserDn(username);
ctx.setPassword(password);
ctx.setPooled(pooled);
ctx.afterPropertiesSet();
return ctx;
}
现在构建一个 LdapQuery 并使用 LdapTemplate 进行搜索
推荐阅读
- r - 在 Rmarkdown 中添加到绘图曲线或直线
- android - 如何在 Android 中以编程方式添加带有 actionLayout 的 menuItem?
- python - Python - 如何使用 MongoDB (pymongo) 和 multiproccesing 而无需“在 fork 之前打开 MongoClient”。问题?
- unity3d - 进入房间的最少玩家数量 PHOTON
- tableau-api - 在 Tableau 中查找过去 29 天的活跃用户数
- linux - 为什么在查看某些文件时,终端输出中会出现“^M”?
- c# - 如何在 ASP.NET Core 3.1 中使用参数进行路由
- python - TypeError:add_info()缺少1个必需的位置参数:Flask中的'writer'
- azure-active-directory - 如何使用 Graph API 获取 SharePoint 用户配置文件
- excel - Excel 2010 显示了一个糟糕的数学结果。有人可以解释我为什么吗?