【发布时间】: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