使用证书调用Windows Azure ACS时出错

时间:2013-06-20 09:03:25

标签: azure

我正在尝试使用客户端使用证书对服务总线进行身份验证,我收到以下错误 -

{“error”:“invalid_client”,“error_description”:“ACS50008:SAML令牌无效。\ r \ nTrace ID:40fd75f3-7a9c-490f-9708-8ee24c1b8d6c \ r \ n相关ID:faaeba2f-4d0e-4b67 -a12e-32b9a8006aad \ r \ n时间戳:2013-06-19 11:40:05Z“}

但那里没有太多细节,我在网上找不到任何东西。

我发送的http请求是 -

POST https://[ACS.accesscontrol.windows.net/v2/OAuth2-13 HTTP/1.1 SB Namespace]

Content-Type: application/x-www-form-urlencoded

Host: [ACS SB Namespace].accesscontrol.windows.net

Content-Length: 2902

Expect: 100-continue

Connection: Keep-Alive

并且正文中的SAML令牌(为清晰起见而解码) -

<Assertion ID="_71323c38-9f7d-4e34-9681-25ab3338cca4" IssueInstant="2013-06-19T11:58:46.233Z" Version="2.0" xmlns="urn:oasis:names:tc:SAML:2.0:assertion"> 
<Issuer>OAuth2SampleX509Identity</Issuer> 
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> 
<ds:SignedInfo> 
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> 
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" /> 
<ds:Reference URI="#_71323c38-9f7d-4e34-9681-25ab3338cca4"> 
<ds:Transforms> 
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /> 
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> 
</ds:Transforms> 
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /> 
<ds:DigestValue>TKIR+dse+tMuZxXCzFO+C7QcCj25xWQ2Uzax1YUmpdQ=</ds:DigestValue> 
</ds:Reference> 
</ds:SignedInfo> 
<ds:SignatureValue>oCP8si[removed for brevity]</ds:SignatureValue> 
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> 
<X509Data> 
<X509Certificate>[remove for brevity]</X509Certificate> 
</X509Data> 
</KeyInfo> 
</ds:Signature> 
<Subject> 
<NameID>OAuth2SampleX509Identity</NameID> 
<SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer" /> 
</Subject> 
<Conditions NotBefore="0001-01-01T00:00:00.000Z" NotOnOrAfter="9999-12-31T23:59:59.999Z"> 
</AudienceRestriction> 
</Conditions> 
</Assertion>

我正在使用来自http://msdn.microsoft.com/en-us/library/hh127795.aspx的客户端对此进行测试,并且相信我已经配置了ACS 说明(虽然我使用SB生成的ACS命名空间,但我认为这不重要?)

1 个答案:

答案 0 :(得分:1)

这次失败的原因是SAML断言中的发行人与我试图通过身份验证的服务身份的名称不匹配