【问题标题】:SAML based SSO for Authentication and LDAP for authorization - Spring Boot Security基于 SAML 的 SSO 用于身份验证和 LDAP 用于授权 - Spring Boot Security
【发布时间】:2020-09-27 21:06:21
【问题描述】:

将 Gsuite 与 Cloud Identity 专业版结合使用

a) 将 GSuite 初始化为 iDP,作为 SSO 的 SAML 应用程序 b) 用于读取用户信息和组信息以进行授权的安全 LDAP 客户端。

真的很困惑如何将 LDAP 客户端(作为授权提供者)与 SAML SSO(身份验证提供者)一起注册。

【问题讨论】:

  • 请注意LDAP需要连接证书而不是用户名和密码
  • 到目前为止你尝试了什么?
  • SAML SSO 工作正常...不知道如何注册 LDAP...所有示例都基于身份验证...没有什么比通过 SAML 的 Authn 和通过 LDAP 的 Authz显而易见的选择)
  • 所以,到目前为止,您显然没有尝试过任何事情。
  • 我确实将证书添加到 /resource/cert 文件夹并注册了它们,但后来无法弄清楚如何测试连接性的无数复杂性

标签: spring-security ldap single-sign-on saml-2.0 google-workspace


【解决方案1】:

使用 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 进行搜索

【讨论】:

  • 这篇文章看起来不像是试图回答这个问题。这里的每一篇文章都应该明确地尝试回答这个问题;如果您有批评或需要澄清问题或其他答案,您可以在其下方直接post a comment(如这个)。请删除此答案并创建评论或新问题。见:Ask questions, get answers, no distractions
猜你喜欢
  • 2014-05-06
  • 2022-01-17
  • 2016-06-09
  • 2021-02-11
  • 2020-09-08
  • 2021-02-24
  • 2021-07-07
  • 2018-08-25
  • 2016-03-13
相关资源
最近更新 更多