metadata - 如何为 ADFS 2.0 创建 "Relying Party Trust"和 "Claims Provider Trusts"的联合元数据 XML

标签 metadata adfs2.0 federation

我们的一个网络应用程序想要连接ADFS 2.0服务器以获取凭据 token 并据此检查用户角色。 ADFS 服务器管理员要求我们向他们提供联合元数据 XML 文件,以便他们创建依赖方信任。我用谷歌搜索,只找到如何使用 URL 下载 ADFS 服务器的联合元数据 XML - https://[adfs 服务器名称]/federationmetadata/2007-06/federationmetadata.xml 但找不到任何指南来创建联合元数据 XML 来创建“依赖方信任”和“声明提供者信任”。是否有用于创建这些元数据文件的工具?请分享一些关于如何创建的想法。

谢谢

回答我自己的问题:

我在 WindowsIdentityFoundation-SDK-4.0 中找到了联合实用程序工具,网址为 http://www.microsoft.com/en-ca/download/details.aspx?id=4451会做的。

最佳答案

实际上网址是

https://server/federationmetadata/2007-06/federationmetadata.xml

据我所知,没有任何工具。

您可以使用Microsoft.IdentityModel.Protocols.WSFederation.Metadata上课或引用Generating Federation Metadata Dynamically .

看看 “Thinktecture.IdentityServer.v2/src/Libraries/Thinktecture.IdentityServer.Protocols/FederationMetadata”位于 Thinktecture.IdentityServer.v2 .

或者,如果您的应用程序使用 WIF,则它位于元数据目录中。

更新:

在 WIF 中,除非您希望对 token 进行加密,否则不需要证书。这对于 ADFS 端来说更重要,因为它必须签署 token 和应用程序。需要公钥来验证。

示例:

<?xml version="1.0" encoding="utf-8"?>
<EntityDescriptor ID="_5b6cd05c-a5e3-470d-a2fc-6c6f66633d1b" entityID="http://localhost/app/" xmlns="urn:oasis:names:tc:SAML:2.0:metadata">
    <RoleDescriptor xsi:type="fed:ApplicationServiceType" xmlns:fed="http://docs.oasis-open.org/wsfed/federation/200706" protocolSupportEnumeration="http://docs.oasis-open.org/wsfed/federation/200706" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <fed:ClaimTypesRequested>
            <auth:ClaimType Uri="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" Optional="true" xmlns:auth="http://docs.oasis-open.org/wsfed/authorization/200706" />
            <auth:ClaimType Uri="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" Optional="true" xmlns:auth="http://docs.oasis-open.org/wsfed/authorization/200706" />
        </fed:ClaimTypesRequested>
        <fed:TargetScopes>
            <EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
                <Address>http://localhost/app/</Address>
            </EndpointReference>
        </fed:TargetScopes>
        <fed:PassiveRequestorEndpoint>
            <EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
                <Address>http://localhost/app/</Address>
            </EndpointReference>
        </fed:PassiveRequestorEndpoint>
    </RoleDescriptor>
</EntityDescriptor>

其中 localhost\app\需要是您应用程序的 URL。注意结束斜杠!

关于metadata - 如何为 ADFS 2.0 创建 "Relying Party Trust"和 "Claims Provider Trusts"的联合元数据 XML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27064826/

相关文章:

php - PHP自动生成META标签

html - 元名称和元属性有什么区别?

sas - SAS METADATA_GET* 函数中的任何一个都可以提供有关授权的信息吗

asp.net - 使用本地 ADFS STS 在 ASP.NET 应用程序和 Office365 之间进行单点登录

asp.net - ADFS 2.0超时以及Freshness Value,TokenLifetime和WebSSOLifetime参数之间的关系

java - HLA - timeAdvanceRequest() 的用法

oracle - 如何查询Oracle目录的权限?

asp.net - 限制 ADFS 2.0 使用特定 OU 而不是域级别访问

kubernetes - Kubernetes federation v2 的状态

sql - 联邦sql View azure