如何将 SP 连接到 .local 域上的 IdP?

How to connect SP to IdP on .local domain?

我正在尝试使用 AD FS 2.0 服务器生成的 FederationMetadata.xml 文件配置 SimpleSAMLphp(其中一些您可以在下面看到 - 我已将域的中间部分替换为 "domain").

由于我们的 Web 应用程序不在他们的网络上,因此无法看到 .local 域中的机器。我不太了解 ADFS 和 SAML,但我认为 IdP 端点必须可由 SP 访问。然而,IdP 的技术联系人一直说我们只需要这个文件,SP 在网络外部并不重要。

我在这里遗漏了什么吗? IdP 和 SP 可以使用此元数据进行通信吗?

<EntityDescriptor ID="**ID**" entityID="http://adfs2.domain.local/adfs/services/trust" xmlns="urn:oasis:names:tc:SAML:2.0:metadata">
<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="**URI**">
            <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>**digest**</ds:DigestValue>
        </ds:Reference>
    </ds:SignedInfo>
    <ds:SignatureValue>**signature**</ds:SignatureValue>
    <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
        <X509Data>
            <X509Certificate>**cert**</X509Certificate>
        </X509Data>
    </KeyInfo>
</ds:Signature>
<RoleDescriptor xsi:type="fed:ApplicationServiceType" protocolSupportEnumeration="http://docs.oasis-open.org/ws-sx/ws-trust/200512 http://schemas.xmlsoap.org/ws/2005/02/trust http://docs.oasis-open.org/wsfed/federation/200706" ServiceDisplayName="adfs2.domain.local" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fed="http://docs.oasis-open.org/wsfed/federation/200706">
    <KeyDescriptor use="encryption">
        <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
            <X509Data>
                <X509Certificate>**cert**</X509Certificate>
            </X509Data>
        </KeyInfo>
    </KeyDescriptor>
    <fed:ClaimTypesRequested>
        <auth:ClaimType Uri="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" Optional="true" xmlns:auth="http://docs.oasis-open.org/wsfed/authorization/200706">
            <auth:DisplayName>E-Mail Address</auth:DisplayName>
            <auth:Description>The e-mail address of the user</auth:Description>
        </auth:ClaimType>
        <auth:ClaimType Uri="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname" Optional="true" xmlns:auth="http://docs.oasis-open.org/wsfed/authorization/200706">
            <auth:DisplayName>Given Name</auth:DisplayName>
            <auth:Description>The given name of the user</auth:Description>
        </auth:ClaimType>

        ...

    </fed:ClaimTypesRequested>
    <fed:TargetScopes>
        <EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
            <Address>https://adfs2.domain.local/adfs/services/trust/2005/issuedtokenmixedasymmetricbasic256</Address>
        </EndpointReference>
        <EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
            <Address>https://adfs2.domain.local/adfs/services/trust/2005/issuedtokenmixedsymmetricbasic256</Address>
        </EndpointReference>
        <EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
            <Address>https://adfs2.domain.local/adfs/services/trust/13/issuedtokenmixedasymmetricbasic256</Address>
        </EndpointReference>
        <EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
            <Address>https://adfs2.domain.local/adfs/services/trust/13/issuedtokenmixedsymmetricbasic256</Address>
        </EndpointReference>
        <EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
            <Address>https://adfs2.domain.local/adfs/ls/</Address>
        </EndpointReference>
        <EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
            <Address>http://adfs2.domain.local/adfs/services/trust</Address>
        </EndpointReference>
    </fed:TargetScopes>
    <fed:ApplicationServiceEndpoint>
        <EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
            <Address>https://adfs2.domain.local/adfs/services/trust/2005/issuedtokenmixedasymmetricbasic256</Address>
        </EndpointReference>
    </fed:ApplicationServiceEndpoint>
    <fed:PassiveRequestorEndpoint>
        <EndpointReference xmlns="http://www.w3.org/2005/08/addressing">
            <Address>https://adfs2.domain.local/adfs/ls/</Address>
        </EndpointReference>
    </fed:PassiveRequestorEndpoint>
</RoleDescriptor>
</EntityDescriptor>

您的 SP 和他们的 IdP 根本不需要通信。一旦您交换了元数据,您的 SP 和他们的 IdP 之间就会建立信任。 SAML 对如何交换元数据没有要求。有些人通过电子邮件完成,有些人将其发布到网络服务器,其他人在他们的 IdP 或 SP 上动态生成它,有些人只会为您提供数据值(证书、端点等)并让您自己构建元数据。

重要的是登录的用户可以访问 SP 和 IdP。最常见的 SAML 配置文件是 SP 将用户的浏览器重定向到 IdP,然后在登录后,IdP 使浏览器 POST 返回到 SP。

还有其他不常用的 SAML 配置文件,需要 SP 与 IdP 通信。在您的情况下,IdP 不支持该配置文件。