【问题标题】:NameID element must be present as part of the SubjectNameID 元素必须作为主题的一部分出现
【发布时间】:2016-09-29 18:22:51
【问题描述】:

嘿,我正在尝试使用我的服务提供商配置 IDP,但是当 saml 响应来自 IDP 时,我在我的服务提供商中收到此错误

org.opensaml.common.SAMLException:NameID 元素必须作为主题的一部分出现在响应消息中,请在 IDP 配置中启用它 在 org.springframework.security.saml.websso.WebSSOProfileConsumerImpl.processAuthenticationResponse

我在 idp - metadata xml 中配置了 NameId

   <NameID>urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</NameID>
            <NameIDFormat>urn:mace:shibboleth:1.0:nameIdentifier</NameIDFormat>
                <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>

here is the whole response


<?xml version="1.0" encoding="UTF-8"?><saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" Destination="http://localhost:8082/saml/SSO" ID="_9129c7121ce71d24e32d5dfe527bd760" InResponseTo="a1eei99dgc9442d72a98h62i9d179j9" IssueInstant="2016-05-31T15:52:04.736Z" Version="2.0">
   <saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">idp.test.com/idp/shibboleth</saml2:Issuer>
   <saml2p:Status>
      <saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
   </saml2p:Status>
   <saml2:EncryptedAssertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
      <xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="_4fcade81e4aae59bfa099e692158a687" Type="http://www.w3.org/2001/04/xmlenc#Element">
         <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"/>
         <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
            <xenc:EncryptedKey Id="_bd99cfd23b6342cf0b4adf7fa03d203f" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
               <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
                  <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/>
               </xenc:EncryptionMethod>
               <ds:KeyInfo>
                  <ds:X509Data>
                     <ds:X509Certificate></ds:X509Certificate>
                  </ds:X509Data>
               </ds:KeyInfo>
               <xenc:CipherData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
                  <xenc:CipherValue>ssss</xenc:CipherValue>
               </xenc:CipherData>
            </xenc:EncryptedKey>
         </ds:KeyInfo>
         <xenc:CipherData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
            <xenc:CipherValue>!!!</xenc:CipherValue>
         </xenc:CipherData>
      </xenc:EncryptedData>
   </saml2:EncryptedAssertion>
</saml2p:Response>

我不明白什么是 nameID 以及如何配置它 我会感谢你的帮助 tnx

【问题讨论】:

  • 您是否检查了您的 IDP 配置是否在声明规则中正确配置了 NameId 字段?
  • 据我所知,声明规则是活动目录的一部分,我不使用 AD。我有像 SP 和身份提供者一样的网络应用程序(spring saml)。你知道那个nameID是什么吗,我需要在哪里配置。我找不到任何好的文档。谢谢

标签: saml-2.0 spring-saml shibboleth


【解决方案1】:

在 SAML 世界中,有两种方法可以将用户的身份返回给 SP。主题区域或属性声明区域。许多较新的 SP 配置在属性语句中使用属性,但仍应填充主题区域。如果 SP 使用属性来获取用户的身份,则配置 Shibboleth 以将 transientId 返回给相关 SP。否则,您需要参考 SP 文档/配置或元数据来确定 SP 支持哪些 NameID 格式,并配置 Shibboleth 以返回具有适当格式的适当值。

一个很好的后续阅读是一个 shib 用户的线程:http://shibboleth.1660669.n2.nabble.com/No-NameID-released-td7605312.html

【讨论】:

  • tnx 帮助我在属性解析器和 在属性过滤器中
猜你喜欢
  • 2014-12-05
  • 1970-01-01
  • 2019-07-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-08-01
  • 2022-01-10
  • 1970-01-01
相关资源
最近更新 更多