【问题标题】:How to map SAML assertion attribute values onto roles in SP with PicketLink?如何使用 PicketLink 将 SAML 断言属性值映射到 SP 中的角色?
【发布时间】:2014-12-18 08:14:31
【问题描述】:

我们正在实施基于 SAML2 的 SSO 解决方案,并在 SP 端使用 PicketLink。

在 IDP 方面,我们有一个不同的实现,它被配置为输出多值 memberOf 属性(这些实际上是 LDAP/AD 组成员资格。所以我们在断言中基本上得到了类似的东西:

<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ... >
    ...
    <saml:Assertion ...>
        ...
        <saml:AttributeStatement>
            <saml:Attribute FriendlyName="Role" Name="Role">
                <saml:AttributeValue>authenticated</saml:AttributeValue>
            </saml:Attribute>
            <saml:Attribute FriendlyName="memberOf" Name="memberOf">
                <saml:AttributeValue>CN=ga-A-102213-...</saml:AttributeValue>
                <saml:AttributeValue>CN=g-z-MeetingPlace,...</saml:AttributeValue>
                <saml:AttributeValue>CN=g-z-Serviceportal,...</saml:AttributeValue>
                <saml:AttributeValue>CN=g-z-BCM...</saml:AttributeValue>
                ...
            </saml:Attribute>
        </saml:AttributeStatement>
        ...
    </saml:Assertion>
</samlp:Response>

我的问题是,如何配置 PicketLink/JBoss 以将这些 memberOf 值映射到应用程序/SP 中的特定角色?

例如,CN=g-z-MeetingPlace,... 应该映射到 ROLE_MEETINGCN=g-z-BCM... 应该映射到 ROLE_BCM。我们可能可以编写一个登录模块来做到这一点,但对我来说这似乎是一项非常标准的任务。但是我还没有找到配置解决方案。

【问题讨论】:

    标签: saml saml-2.0 picketlink


    【解决方案1】:

    看来我们已经想通了。

    我们需要的是org.jboss.security.auth.spi.RoleMappingLoginModule:

    <login-module code="org.jboss.security.auth.spi.RoleMappingLoginModule"
      flag="optional"> 
      <module-option name="rolesProperties">roles.properties</module-option>
    </login-module>
    

    roles.properties文件中配置AD组名称和内部应用角色之间的映射:

    CN\=ga-A-102213-...=SomeInternalRole
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-25
      • 2017-10-18
      • 1970-01-01
      • 2021-04-29
      • 1970-01-01
      • 2018-09-21
      • 1970-01-01
      • 2014-09-06
      相关资源
      最近更新 更多