首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SAML2.0和EncryptedAssertion

SAML2.0和EncryptedAssertion
EN

Stack Overflow用户
提问于 2012-02-02 00:51:15
回答 1查看 2.2K关注 0票数 0

我对这个声明和SAML概念还很陌生。我正在使用来自ASP.NET的WIF,并从我的IDP收到下面的请求。我通过http请求发送了用户名/密码,并收到了此SAML响应。我现在到底该怎么做?我听说我需要验证签名和密钥,如果是这样的话,如何(.NET)和为什么?

代码语言:javascript
复制
<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>
- <o:SecurityTokenReference xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
- <X509Data>
- <X509IssuerSerial>
<X509IssuerName>CN=LeastPrivilegeCA</X509IssuerName> 
<X509SerialNumber>458206499362374248562711</X509SerialNumber> 
</X509IssuerSerial>
</X509Data>
</o:SecurityTokenReference>
</KeyInfo>
- <e:CipherData>
<e:CipherValue>SOME DATA</e:CipherValue> 
</e:CipherData>
</e:EncryptedKey>
</KeyInfo>
- <xenc:CipherData>
<xenc:CipherValue>SOME DATA</xenc:CipherValue> 
</xenc:CipherData>
</xenc:EncryptedData>
</EncryptedAssertion>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-02-02 04:15:27

要将SAML2.0与Windows Identity Foundation (WIF)一起使用,您需要WIF Extension for the SAML 2.0 Protocol。下载后,您将找到一些关于如何使用SAML令牌进行身份验证的很好的示例。

你真的不需要手动做任何事情来解析这个令牌,因为WIF应该为你管理所有这些。您只需要确保安装并配置了正确的证书来解密消息。如果您使用的是SAML2.0扩展,这将在web.config中引用的服务提供者配置中进行设置:

代码语言:javascript
复制
<microsoft.identityModel.saml metadata="bin\App_Data\serviceprovider.xml">
    <!-- The location of the configuration files of all the partners this service trusts. -->
    <identityProviders>
        <metadata file="bin\App_Data\identityprovider.xml"/>
    </identityProviders>
</microsoft.identityModel.saml>

希望这能有所帮助。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9099783

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档