【问题标题】:SAML Single logout through OKTASAML 通过 OKTA 单次注销
【发布时间】:2017-02-23 07:11:57
【问题描述】:

我收到了以下 SP 的请求和 IDP 的回复:

<samlp:LogoutRequest xmlns="urn:oasis:names:tc:SAML:2.0:metadata" Destination="https://dev-nnn.oktapreview.com/app/somename_hped800eportal_1/exk8dlkd0tCutHWlj0h7/slo/saml" ID="_af6eaa4a-9d5b-41ce-b265-d39dfdc5248e" Version="2.0" IssueInstant="2016-10-14T12:31:59Z" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"><saml:Issuer xmlns:saml="http://www.w3.org/2005/Atom">https://HPED800E:444/SynPortal/login.aspx</saml:Issuer><saml:NameID xmlns:saml="urn:oasis:names:tc:SAML:2.0:nameid-format:unspecified">CDA_Main\hjami</saml:NameID><samlp:SessionIndex>_d9f07562-3a7f-4c03-a62d-8a985f34058f</samlp:SessionIndex><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>bBbMvzSjRc0zc1jtIxmqmkO4bYo=</DigestValue></Reference></SignedInfo><SignatureValue>...5g==</SignatureValue><KeyInfo><X509Data><X509Certificate>...Cw==</X509Certificate></X509Data></KeyInfo></Signature></samlp:LogoutRequest>

<?xml version="1.0" encoding="UTF-8"?><saml2p:LogoutResponse xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" Destination="https://hped800e:444/SynPortal/logout.aspx" ID="id50277036872307661186452042" InResponseTo="_1eef2809-b49e-412e-a0c5-3596e3c0b158" IssueInstant="2016-10-14T00:32:05.949Z" Version="2.0"><saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">http://www.okta.com/exk8dlkd0tCutHWlj0h7</saml2:Issuer><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/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI="#id50277036872307661186452042"><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/2000/09/xmldsig#sha1"/><ds:DigestValue>3k7z8GF3kBemyYm+6+mEbZMSAYw=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>...MA==</ds:SignatureValue><ds:KeyInfo><ds:X509Data><ds:X509Certificate>...VNm</ds:X509Certificate></ds:X509Data></ds:KeyInfo></ds:Signature><saml2p:Status xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"><saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:AuthnFailed"/></saml2p:Status></saml2p:LogoutResponse>

请求以 base-64 编码,然后通过后绑定发送。 我收到了 AuthnFailed 响应。

为简单起见,我只为 IDP 设置了一个 sp。 有谁知道我在这里做错了什么?

【问题讨论】:

    标签: saml logout okta-api


    【解决方案1】:

    此信息不足以确定您的单次注销实施中出了什么问题。能否提供以下信息

    1) 您在 Okta 中的单次注销设置可以在您应用的“常规”选项卡下的 SAML 设置 -> 高级设置下找到?

    2) 根据上述设置,请确保您已将证书上传到 Okta?

    3) 您使用的是哪个 SAML 工具包?能否为您的工具包提供工具包设置?

    请参阅下面的有效 SLO 请求。

    <samlp:LogoutRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
    xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
    ID="_d2be8c5de3aeeeac27c8xxxxyyyy"
    Version="2.0"
    IssueInstant="2016-04-27T16:15:06Z"
    Destination="https://org-name.okta.com/app/simplesamlphpexample/exk4xxyyPcvdVq70x7/slo/saml"
    >
    <saml:Issuer>http://localhost:8888/simplesamlphp/www/module.php/saml/sp/metadata.php/example-okta-com</saml:Issuer>
    <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/2000/09/xmldsig#rsa-sha1" />
            <ds:Reference URI="#_d1be8c5dc2aeeeac27c8daf04b7xxxyyy6b36287bd6">
                <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/2000/09/xmldsig#sha1" />
                <ds:DigestValue>{{some_value}}</ds:DigestValue>
            </ds:Reference>
        </ds:SignedInfo>
        <ds:SignatureValue>{{some_value}}</ds:SignatureValue>
        <ds:KeyInfo>
            <ds:X509Data>
                <ds:X509Certificate>{{some_value}}</ds:X509Certificate>
            </ds:X509Data>
        </ds:KeyInfo>
    </ds:Signature>
    <saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">{{email}}</saml:NameID>
    <samlp:SessionIndex>{{some_value}}</samlp:SessionIndex>
    

    比较您的请求和我的请求的 SLO 设置,有几处突出。

    1) 在我的例子中,CanonicalizationMethod 算法设置为http://www.w3.org/2001/10/xml-exc-c14n#。你的是http://www.w3.org/TR/2001/REC-xml-c14n-20010315

    2) 在您的情况下,名称 ID 是“CDA_Main\hjami”。你能告诉我这是 Okta 中的哪个属性吗?此外,您是否使用从 Okta 到应用程序的映射(在配置文件编辑器 -> 您的应用程序映射下)覆盖了您的应用程序的用户名。例如,我将 Okta 登录/电子邮件中的应用程序用户名覆盖为自定义属性。

    如果您使用来自 Okta 的另一个属性(其值设置为 CDA_Main\hjami)作为应用程序的用户名,请确保您像我在上面的屏幕截图中所做的那样覆盖它。

    【讨论】:

    • 请注意,您上面的“工作 SLO 请求”不包括结束标记:&lt;/samlp:logoutrequest&gt;
    • @sohaib Ajmal 摘要值、签名值和证书的值是什么?是服务提供商证书还是IDP证书?
    • 我有一个格式与此完全相同的 LogoutRequest,使用完全相同的算法,但我仍然收到无效签名错误
    猜你喜欢
    • 2018-01-24
    • 1970-01-01
    • 2015-05-03
    • 2021-12-12
    • 2021-05-13
    • 1970-01-01
    • 2017-06-10
    • 2019-09-20
    • 2021-04-11
    相关资源
    最近更新 更多