2016-05-31 72 views
0

嘿,我想用我的服務提供商配置IDP但是當SAML響應來自IDP我在服務提供商NameID元素必須作爲主體的一部分

org.opensaml.common.SAMLException得到這個錯誤:NameID元素必須存在作爲響應消息的主題的一部分,請啓用它在IDP配置 在org.springframework.security.saml.websso.WebSSOProfileConsumerImpl.processAuthenticationResponse

我在IDP配置填充NameID - 元數據XML

<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如何配置 有回報用戶的身份到SP的兩種方式,我會感謝您的幫助 TNX

+0

您是否檢查了IDP配置是否在聲明規則中正確配置了NameId字段? – ManojP

+0

據我所知,聲明規則是活動目錄的一部分,我不使用AD。我有像SP和身份提供者那樣的web應用程序(spring saml)。你知道什麼是nameID,我需要在哪裏配置。我找不到任何好的文檔。謝謝 –

回答

1

在SAML世界。 「主題」區域或「屬性聲明」區域。許多較新的SP配置在屬性語句中使用屬性,但仍應填充主題區域。如果SP使用屬性獲取用戶身份,則將Shibboleth配置爲將transientId返回給相關SP。否則,您需要參考SP文檔/配置或元數據來確定SP支持哪些NameID格式,並配置Shibboleth以適當的格式返回適當的值。

一個好的後續閱讀是一個shib用戶的線程:http://shibboleth.1660669.n2.nabble.com/No-NameID-released-td7605312.html

+0

TNX的幫助下,我的用戶transientId在屬性解析器和 in atribute filter –

相關問題