ADFS/SAML2.0 - 如何通过联邦元数据设置声明规则?

ADFS/SAML2.0 - How to set Claim Rules through Federation Metadata?

我正在尝试针对 Web 应用程序的 Windows ADFS 实施 SAML 2.0 身份验证。到目前为止,我通过手动配置依赖方信任和分配的声明规则,成功地验证并从 ADFS 获得了我需要的东西。

现在我想为我的应用程序提供联合元数据,以便更轻松地在 ADFS 中设置所需的内容。但是我不知道如何在该元数据中传递所需的声明规则。

这是我目前的情况:

<?xml version="1.0"?>
<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" entityID="dokuwiki-entity" validUntil="2015-03-24T20:30:16Z">
  <SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" WantAssertionsSigned="true">
    <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</NameIDFormat>
    <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</NameIDFormat>
    <AssertionConsumerService index="1" isDefault="true" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://perd.cosmo/dw-2014-01-13/doku.php?id=start"/>

    <AttributeConsumingService index="1">
      <ServiceName xml:lang="en">DokuWiki</ServiceName>
      <RequestedAttribute isRequired="true" Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri" FriendlyName="E-Mail-Adresse" />
    </AttributeConsumingService>
  </SPSSODescriptor>
  <Organization>
    <OrganizationName xml:lang="en">DokuWiki</OrganizationName>
    <OrganizationDisplayName xml:lang="en">DokuWiki</OrganizationDisplayName>
    <OrganizationURL xml:lang="en">https://www.dokuwiki.org</OrganizationURL>
  </Organization>
</EntityDescriptor>

根据我的理解,RequestedAttribute 应该告诉 ADFS 在验证时向我发送用户的电子邮件地址。不幸的是,在使用此元数据设置依赖方信任后,未设置声明规则。

问题:是否可以通过元数据设置声明规则,还是必须始终手动完成?如果可能的话,我在哪里可以找到合适的文档?

您必须手动设置声明规则(或通过 powershell)。 ADFS 不查看元数据的那部分。