我们有一个声明感知应用程序,并使用 ADFS 服务器对来 self 们合作伙伴网络的用户进行身份验证。拥有自己的 ADFS 服务器的客户没有问题。他们的 ADFS 服务器以 SAML 1.0 格式向我们发送 token ,一切都很好。我们有一个客户端主动向我们的 ADFS 服务器发送 SAML 2.0 信息。信任关系有效,用户进入我们的系统,但没有任何声明得到通过。我们得到的只是这个(来 self 们的应用程序日志文件):
9/1/2015 7:35:44 PM: Claim type = http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod, value = urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
9/1/2015 7:35:44 PM: Claim type = http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationinstant, value = 2015-09-01T23:35:40.194Z
与 SAML token 相比,格式有很大不同。例如,SAML 1 中有一个自定义声明,如下所示:
<saml:Attribute xmlns:a="http://schemas.xmlsoap.org/ws/2009/09/identity/claims" AttributeName="customerguid" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims" a:OriginalIssuer="http://Absolut.vis-intel.net/adfs/services/trust">
<saml:AttributeValue>8835cf46-07a6-45f7-82d9-978905b5911f</saml:AttributeValue>
</saml:Attribute>
但是他们的进来是这样的:
<saml2:Attribute Name="CustomerGuid">
<saml2:AttributeValue>b4f3dd70-ef42-4596-be76-3e3fa077d06e</saml2:AttributeValue>
</saml2:Attribute>
我们认为也许我们需要对声明规则做一些事情。它们看起来类似于:
c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/customerguid"]
=> issue(claim = c);
我们添加了自定义声明类型并尝试更改声明规则以使用它们来尝试获取 CustomerGuid,但这没有什么区别:
c:[Type == "CustomerGuid"] => issue(claim = c);
寻找有关如何完成这项工作的任何指示。
最佳答案
这不是由于 SAML 版本的差异造成的。
当从 IDP 发布 SAML 属性时,属性名称通常使用名称格式进行限定。此处缺少此名称格式。
您需要请求客户 IDP 以所需的格式发布声明,或者使用您的中介 ADFS 转换为 SP/RP 期望的格式。
如果您的依赖方需要名称格式 -
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/customerguid
那么 IDP 应按以下格式发布 SAML 声明:
<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/customerguid">
<AttributeValue>b4f3dd70-ef42-4596-be76-3e3fa077d06e</AttributeValue>
</Attribute>
如需进一步阅读,请参阅 SAML 规范的这一部分:
关于SAML 2.0 声明未通过 ADFS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32342584/