【问题标题】:Returning the username as is in the SAML assertion in Shibboleth IDPV3.3在 Shibboleth IDPV3.3 的 SAML 断言中返回用户名
【发布时间】:2018-12-14 15:46:55
【问题描述】:

我正在使用 Shibboleth IDPv3.3 与我们的 SP 集成,并且能够使用 LDAP 进行 SSO 身份验证。

但是我看到的 NameID 是生成的,而不是我在身份验证期间输入的

 <saml2:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
                          NameQualifier="https://shib.nslab.com/idp/shibboleth"
                          SPNameQualifier="https://chandracppm.nslab.com/networkservices/saml2/sp"
                          >7DBQ2seeNYvP9l6RsCrJZRh8/kw=</saml2:NameID>

对于我们的 SP,我们希望将用户在登录页面中输入的实际用户名作为 NameID 返回。

我需要做哪些配置来实现这一点。

【问题讨论】:

    标签: shibboleth


    【解决方案1】:

    通过执行以下操作,我能够让 Shibboleth IDP v3.3 返回作为 NameID 在 SAML 响应中输入的用户名

    在attribute-resolver.conf中

    <AttributeDefinition id="uid" xsi:type="PrincipalName">
        <AttributeEncoder xsi:type="SAML1String" name="urn:mace:dir:attribute-def:uid" encodeType="false" />
        <AttributeEncoder xsi:type="SAML2String" name="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" friendlyName="uid" encodeType="false" />
    </AttributeDefinition>
    

    在 SP 元数据中指定 NameID 格式

    <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</NameIDFormat>
    

    在 saml-nameid.xml 中

    注释掉除

    之外的所有其他bean
     <util:list id="shibboleth.SAML2NameIDGenerators">
    <bean parent="shibboleth.SAML2AttributeSourcedGenerator"
            p:format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
            p:attributeSourceIds="#{ {'uid'} }" />
    

    通过这 3 项配置并确保将属性过滤器设置为释放所有属性,我能够填充用户在 Shibboleth IDP 中输入的 UserID 作为响应断言。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多