【发布时间】:2018-06-17 07:57:38
【问题描述】:
目前我正在使用 ADFS 登录。我正在从 Adfs 服务器获得响应。但我无法从响应 Saml 中获取任何信息。我该怎么做才能获取信息?
<br /><br />
<samlp:Response Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified"
Destination="https://demo.apps.com/adfsauthlogin/login"
ID="_cbb5174b-36b4-4e75-9d8a-7f2d47ccb9bc" IssueInstant="2018-01-08T06:09:16.122Z" Version="2.0"
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">http://adfs.Sample.com/adfs/services/trust</Issuer>
<samlp:Status><samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/></samlp:Status>
<EncryptedAssertion xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
<xenc:EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"><xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<e:EncryptedKey xmlns:e="http://www.w3.org/2001/04/xmlenc#">
<e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/></e:EncryptionMethod>
<KeyInfo>
<ds:X509Data xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509IssuerSerial>
<ds:X509IssuerName>CN=ADFS Encryption - demo.apps.com</ds:X509IssuerName>
<ds:X509SerialNumber>33157209971584938906555805034885884694</ds:X509SerialNumber>
</ds:X509IssuerSerial>
</ds:X509Data>
</KeyInfo>
<e:CipherData>
<e:CipherValue> ==- Value -== </e:CipherValue>
</e:CipherData>
</e:EncryptedKey>
</KeyInfo>
<xenc:CipherData>
<xenc:CipherValue> ==- Value -== </xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</EncryptedAssertion>
</samlp:Response>
【问题讨论】:
-
您有来自 AD FS 的响应,并且根据状态代码它是成功的。否则它将显示 urn:oasis:names:tc:SAML:2.0:status:Responder 令牌已加密,这就是为什么您无法以明文形式看到声明的原因。您需要对其进行解密才能查看声明。根据keyinfo,你应该使用“CN=ADFS Encryption - demo.apps.com”来解密。或者,您可以将 AD FS 配置为不加密此应用程序的断言,这意味着您将以明文形式获得声明。没有您用于开发应用程序的堆栈的详细信息,并且相关代码提取它不可能再评论。
标签: asp.net-mvc adfs adfs2.0 adfs3.0