【问题标题】:SAML SSO authentication flow for custom SAML connector in Jumpcloud applicationsJumpcloud 应用程序中自定义 SAML 连接器的 SAML SSO 身份验证流程
【发布时间】:2019-10-26 05:36:16
【问题描述】:

我们正在为我们的一个应用程序尝试JumpCloud 的 IDaaS,并尝试使用自定义 SAML 2.0 连接器配置 SSO 登录。

我们已经在那里配置了一个断言消费者服务端点,它会在用户成功认证后接收 POST 响应。现在我们能够在那里成功接收 SAMLResponse 但我无法在这里弄清楚接下来的步骤?我是否将这个签名/加密的响应按原样传递给 webapp 并将其用于验证 API 请求,或者我是否需要查询 jumpcloud 以获取与此响应关联的令牌。

我读到的一般wikipedia article on SAML2.0 建议我们需要查询工件解析服务,以将收到的断言 saml 响应交换为要在客户端应用程序中使用的令牌。但是我在 jumpcloud 文档中没有找到任何对此的引用。

此外,jumpcloud 中的组织用户会话持续时间设置设置为 1 小时,而 SAMLResponse 中的到期时间似乎仅在令牌创建后 5 分钟,所以如果我们需要延长此令牌持续时间该怎么办,因为我不希望用户每 5 分钟登录一次。

有经验/熟悉 JumpCloud 的人可以在这里帮助/指出正确的方向吗?

这是我从 IDP 收到的示例 SAMLResponse -

<?xml version="1.0" encoding="UTF-8"?>
<saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:xs="http://www.w3.org/2001/XMLSchema" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified" Destination="https://ixr6rl0xpk.execute-api.us-east-1.amazonaws.com/dev/saml" ID="MGAZWYVBHO9VMET0GNQAG1YILCCALLJL1QZUCTLN" IssueInstant="2019-10-24T14:38:11.414Z" 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">jumpcloud</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/2001/04/xmldsig-more#rsa-sha256" />
            <ds:Reference URI="#MGAZWYVBHO9VMET0GNQAG1YILCCALLJL1QZUCTLN">
                <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#">
                        <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="xs" />
                    </ds:Transform>
                </ds:Transforms>
                <ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
                <ds:DigestValue>qQY2SBgD...</ds:DigestValue>
            </ds:Reference>
        </ds:SignedInfo>
        <ds:SignatureValue>H8XemIw1nNCkq7nL...</ds:SignatureValue>
        <ds:KeyInfo>
            <ds:X509Data>
                <ds:X509Certificate>MIIFfTCCA2W...</ds:X509Certificate>
            </ds:X509Data>
        </ds:KeyInfo>
    </ds:Signature>
    <saml2p:Status>
        <saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
    </saml2p:Status>
    <saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" ID="JW4VMBUW3OD8KZJXG07QHLZOLEMNEDDW93H6WPIS" IssueInstant="2019-10-24T14:38:11.414Z" Version="2.0">
        <saml2:Issuer Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">jumpcloud</saml2:Issuer>
        <saml2:Subject>
            <saml2:NameID Format="urn:oasis:names:tc:SAML:1.0:nameid-format:unspecified">email@example.com</saml2:NameID>
            <saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
                <saml2:SubjectConfirmationData NotOnOrAfter="2019-10-24T14:43:11.414Z" Recipient="<ACS_URL>" />
            </saml2:SubjectConfirmation>
        </saml2:Subject>
        <saml2:Conditions NotBefore="2019-10-24T14:33:11.414Z" NotOnOrAfter="2019-10-24T14:43:11.414Z">
            <saml2:AudienceRestriction>
                <saml2:Audience>example.com</saml2:Audience>
            </saml2:AudienceRestriction>
        </saml2:Conditions>
        <saml2:AttributeStatement>
            <saml2:Attribute Name="memberOf" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
                <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">test group</saml2:AttributeValue>
            </saml2:Attribute>
        </saml2:AttributeStatement>
        <saml2:AuthnStatement AuthnInstant="2019-10-24T14:38:11.414Z" SessionIndex="330dafe4-e541-4b93-85b2-2c5d76d75996">
            <saml2:AuthnContext>
                <saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml2:AuthnContextClassRef>
            </saml2:AuthnContext>
        </saml2:AuthnStatement>
    </saml2:Assertion>
</saml2p:Response>

【问题讨论】:

    标签: single-sign-on single-page-application saml saml-2.0


    【解决方案1】:

    通常在SAML 中,用户声明其“登录”服务的权利。在“老式”服务中,他们会通过进入服务的登录页面,输入他们的用户名和密码,如果他们通过身份验证,服务会做“某事”让他们进入。“某事”可以成为任何东西。设置 cookie 会话或其他。那个“某事”与SAML 无关。 SAML 只传输他们的断言。

    SAML 中,他们不是输入用户名/密码,而是使用 SAML Response 到达服务,其中包含他们如何在自己的身份提供者 (IdP) 进行身份验证的详细信息以及有关他们的任何属性.

    在您的 SAML Response 中,它们只有一个属性:

    <saml2:Attribute Name="memberOf" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">
      <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">test group</saml2:AttributeValue>
    </saml2:Attribute>
    

    表示它们是memberOf 实体test group

    如果服务允许访问测试组的成员,那么他们可以“登录”,即他们已经成功地维护了他们的权利,告诉服务执行它为非 SAML 用户所做的“某事”。

    无论他们是否拥有老式钥匙、卡、指纹或面部识别技术。一旦验证了该过程的这一部分,该服务就可以使用它使用的任何机制来开门。

    当我启用 SAML 系统时,我会首先查看服务的身份验证和授权代码,以了解下一步是什么(“某事”位)。然后添加一个新端点(ACS)并将其插入现有的“某物”。

    【讨论】:

      猜你喜欢
      • 2017-06-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-29
      • 1970-01-01
      • 2022-10-07
      相关资源
      最近更新 更多