【问题标题】:How to consume SAMLResponse using ADFS?如何使用 ADFS 使用 SAMLResponse?
【发布时间】:2019-03-27 13:26:07
【问题描述】:

我们需要将 ADFS 设置为服务提供商。因此,我们尝试向 ADFS 发送 saml 响应。我们为声明提供者、RPT 配置了存根并创建了证书。我们尝试使用 RelayState 将 saml 发送到 adfs/ls/IdpinitiatedSignon.aspx。

这是 Saml 响应示例。

<samlp:Response ID="_6bcc31a5-fcc2-46a6-a84d-0df2cb5bed17" Version="2.0" IssueInstant="2019-03-27T12:37:34.839Z" Destination="https://srv2012-test-dc.testdomain.com/adfs/ls/idpinitiatedsignon.aspx" InResponseTo="_728ac076-7b14-4ce2-8efb-ed5c8c9b85f3" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
    <Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">anthem.cn.com</Issuer>
    <samlp:Status>
        <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
    </samlp:Status>
    <Assertion ID="_eeaaab87-0fcc-4ec1-93d3-ed623b27130c" IssueInstant="2019-03-27T12:37:41.843Z" Version="2.0" xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
        <Issuer>anthem.cn.com</Issuer>
        <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
            <SignedInfo>
                <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
                <Reference URI="#_eeaaab87-0fcc-4ec1-93d3-ed623b27130c">
                    <Transforms>
                        <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
                        <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
                    </Transforms>
                    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
                    <DigestValue>MkByT8QpjpBFszlr74Rx0IZNewk=</DigestValue>
                </Reference>
            </SignedInfo>
            <SignatureValue>AYhBtCEl4CrsgsuWMaLEDP...</SignatureValue>
            <KeyInfo>
                <X509Data>
                    <X509Certificate>MII...</X509Certificate>
                </X509Data>
            </KeyInfo>
        </Signature>
        <Subject>
            <NameID>VALERA</NameID>
            <SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
                <SubjectConfirmationData InResponseTo="_728ac076-7b14-4ce2-8efb-ed5c8c9b85f3" NotBefore="2019-03-27T12:32:34.839Z" NotOnOrAfter="2019-03-27T13:37:34.847Z"/>
            </SubjectConfirmation>
        </Subject>
        <Conditions>
            <AudienceRestriction>
                <Audience>https://beta3dev.test.com/</Audience>
            </AudienceRestriction>
        </Conditions>
        <AuthnStatement AuthnInstant="2019-03-27T12:37:41.843Z" SessionIndex="_56b775bf-32a7-4f35-a370-d707a653a5aa">
            <AuthnContext>
                <AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:Password</AuthnContextClassRef>
            </AuthnContext>
        </AuthnStatement>
        <AttributeStatement>
            <Attribute Name="FirstName">
                <AttributeValue>valera</AttributeValue>
            </Attribute>
        </AttributeStatement>
    </Assertion>
</samlp:Response>

似乎是有效的,我们通过在线验证器进行了检查,但是 ADFS 抛出异常:

Microsoft.IdentityServer.Web.UnsupportedSamlResponseException:MSIS7029:SAML 响应包含不受支持的内容。

那么,问题是:saml 有什么问题?

附:实际上,我们不知道 idp 发起的场景是如何工作的。也许有一些最低要求,或者我们无法登录,因为我们没有工作存根。很高兴获得有关此数据流的更多信息。

【问题讨论】:

    标签: saml adfs3.0


    【解决方案1】:

    好的,现在可以使用了。

    1. IdP 发起的场景中没有请求,因此我们删除了所有 InResponseTo 属性。
    2. AuthnContext 更改为 PasswordProtectedTransport。

    可以包含名称 ID,但不应包含 NotBefore 属性。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-10-04
      • 2015-06-28
      • 1970-01-01
      • 2015-06-19
      • 2020-02-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多