在SAML 2.0中从ADFS 3.0获取声明并向Shibboleth 2.6 Service Provider(SP)显示

时间:2016-11-15 18:40:47

标签: saml-2.0 windows-server-2012-r2 shibboleth adfs3.0

我正在尝试配置 Windows Server 2012 r2 ADFS 3.0 以将NameID发送到 Shibboleth 2.6 SAML 2.0 SP ,但我继续获取这些错误:

2016-11-15 10:07:07 WARN Shibboleth.AttributeResolver.Query [1]: can't attempt attribute query, either no NameID or no metadata to use
2016-11-15 10:07:07 INFO Shibboleth.SessionCache [1]: new session created: ID (_7e425978e43bc32c86393f518b26eb3e) IdP (https://c-adfs01.contoso.com/FederationMetadata/2007-06/FederationMetadata.xml) Protocol(urn:oasis:names:tc:SAML:2.0:protocol) Address (192.168.50.131)

我了解这有关如何从 ADFS IDP 传递NameID属性并在 Shibboleth SAML 2.0 SP中显示nameID

我还读到您需要在 ADFS IDP 中设置规则以传递Email Address,并将Email address转换为NameID 。我已经做到了,并且有这些规则:

c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"]
 => issue(Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = c.Value, ValueType = c.ValueType, Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");

但是,我观察到配置似乎只与SAML 1.0兼容,但不兼容2.0(可能)。

所以,我继续添加名称属性。我尝试了transientpersistentemailAddress,并尝试了SAML 1.0SAML 2.0配置。

<Attribute name="urn:oasis:names:tc:SAML:2.0:nameid-format:transient" id="NameID"/>
<Attribute name="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" id="NameID"/>
<Attribute name="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" id="NameID"/>

问题:

那么,配置 ADFS IDP 以将NameID发送到 Shibboleth SP 的正确方法是什么,并在转到我的<时显示会话属性strong>应用程序会话页面?

具体来说,我应该期待Claim Rules的正确输出是什么?以及Shibboleth attribute-map.xml的XML配置应该如何?

https://c-app01.contoso.com/Shibboleth.sso/Session

1 个答案:

答案 0 :(得分:0)

<强>解决方案:

解决方案是依赖方中的“发布转换规则”&#34; 标签内创建两条规则。以下是要设置的规则:

  • 将规则添加到将LDAP属性作为声明发送
  • 将规则添加到转换传入声明

此外,请确保允许所有用户访问权限位于颁发授权规则标签内。

说明:

添加规则以将LDAP属性作为声明发送:

  • 声明规则名称:电子邮件
  • 属性存储:Active Directory
  • LDAP的映射:电子邮件地址到电子邮件地址

这将映射电子邮件地址。

添加规则以转换传入声明:

  • 声明规则名称:EmailToNameID
  • 传入索赔类型:电子邮件地址
  • 传出声明类型:名称ID
  • 传出名称ID格式:电子邮件
  • 确保&#34;通过索赔值&#34;被选中。

以上设置&#34;转换传入声明&#34;将为您提供以下索赔规则:

c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"]
 => issue(Type = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", Issuer = c.Issuer, OriginalIssuer = c.OriginalIssuer, Value = c.Value, ValueType = c.ValueType, Properties["http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format"] = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");

之后,您可以配置attribute-map.xml,如下所示:

<Attribute name="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" id="Email"/> 

我的错误:

我发现我的“声明规则”中的每个设置都是正确的,但EmailEmailToNameID的规则应该在颁发转换规则标签下< strong>依赖方。