具有已颁发令牌的WCF联合客户端不';不发送SAML断言签名
我有一个直接针对WIF/WCF活动STS进行身份验证的应用程序。该应用程序也是一个被动STS,充当网站依赖方的WS-Federation端点 当用户登录到网站RP时,他们被重定向到被动STS进行身份验证(用户名和密码),在两步过程中,被动STS(充当主动RP)向STS发送问题RST,并接收签名SAML令牌作为回报。对于第二步骤,被动STS向STS发送第二问题RST,使用在前一步骤中接收到的令牌进行认证 问题在于,在第二步中,WCF客户端从SAML断言中剥离具有已颁发令牌的WCF联合客户端不';不发送SAML断言签名,wcf,wif,saml,ws-federation,ws-trust,Wcf,Wif,Saml,Ws Federation,Ws Trust,我有一个直接针对WIF/WCF活动STS进行身份验证的应用程序。该应用程序也是一个被动STS,充当网站依赖方的WS-Federation端点 当用户登录到网站RP时,他们被重定向到被动STS进行身份验证(用户名和密码),在两步过程中,被动STS(充当主动RP)向STS发送问题RST,并接收签名SAML令牌作为回报。对于第二步骤,被动STS向STS发送第二问题RST,使用在前一步骤中接收到的令牌进行认证 问题在于,在第二步中,WCF客户端从SAML断言中剥离元素,然后将其发送回SOAP头中的STS
元素,然后将其发送回SOAP头中的STS。我已验证(通过测试序列化传递给ChannelFactory.CreateChannelWithIssuedToken
)的令牌,当我在生成的通道上调用IWSTrustContract.Issue
时,该令牌仍然具有签名
这是应提供给STS的断言XML:
<saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="_0a5efbe5-446c-459c-8aaa-dda87748bca2" Issuer="https://sts.environment.com/" IssueInstant="2014-01-30T21:48:56.673Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
<saml:Conditions NotBefore="2014-01-30T21:48:56.673Z" NotOnOrAfter="2014-01-30T22:48:56.673Z">
<saml:AudienceRestrictionCondition>
<saml:Audience>https://login.environment.com/</saml:Audience>
</saml:AudienceRestrictionCondition>
</saml:Conditions>
<saml:AttributeStatement>
<saml:Subject>
<saml:SubjectConfirmation>
<saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<trust:BinarySecret xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512"><!--Removed--></trust:BinarySecret>
</KeyInfo>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Attribute AttributeName="upn" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
<saml:AttributeValue><!--Removed--></saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
<Reference URI="#_0a5efbe5-446c-459c-8aaa-dda87748bca2">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<DigestValue><!--Removed--></DigestValue>
</Reference>
</SignedInfo>
<SignatureValue><!--Removed--></SignatureValue>
<KeyInfo>
<X509Data>
<X509Certificate><!--Removed--></X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
</saml:Assertion>
https://login.environment.com/
urn:oasis:name:tc:SAML:1.0:cm:钥匙座
这是STS根据服务跟踪查看器接收的内容:
<saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="_0a5efbe5-446c-459c-8aaa-dda87748bca2" Issuer="https://sts.environment.com/" IssueInstant="2014-01-30T21:50:27.842Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
<saml:Conditions NotBefore="2014-01-30T21:50:27.841Z" NotOnOrAfter="2014-01-30T22:50:27.841Z">
<saml:AudienceRestrictionCondition>
<saml:Audience>https://login.environment.com/</saml:Audience>
</saml:AudienceRestrictionCondition>
</saml:Conditions>
<saml:AttributeStatement>
<saml:Subject>
<saml:SubjectConfirmation>
<saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:holder-of-key</saml:ConfirmationMethod>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<trust:BinarySecret xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512"><!--Removed--></trust:BinarySecret>
</KeyInfo>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Attribute AttributeName="upn" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
<saml:AttributeValue><!--Removed--></saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
</saml:Assertion>
https://login.environment.com/
urn:oasis:name:tc:SAML:1.0:cm:钥匙座
当然,STS无法验证断言的签名,因为它已被剥离,并且无法对客户端进行身份验证并为网站RP颁发承载令牌
为什么WCF联邦客户端要从断言中剥离签名,我如何才能使它不这样做?您是否找到了发生这种情况的原因?