首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >我如何诊断AWS认知的SAML断言处理错误的原因?

我如何诊断AWS认知的SAML断言处理错误的原因?
EN

Stack Overflow用户
提问于 2022-04-28 21:25:41
回答 1查看 584关注 0票数 0

我正试图将AWS认知与第三方SAML SSO身份提供者集成起来。第三方IdP在登录时使用一个成功的SAML断言进行响应。

然后,科尼图试图验证断言的签名,但是失败了,出现了以下错误消息:

代码语言:javascript
运行
复制
Error in SAML response processing: SAML Assertion signature is invalid

我怎样才能诊断出认知的断言处理的原因?

我们已经用samltest.id测试了我们的认知SP,这是完全有效的。

读取样本测试。‘s的常见问题时,Shibboleth (与我的解决方案无关)的签名验证错误通常意味着“用于对断言进行签名的密钥与IdP元数据中的usage="signing"或null用法不匹配”。

下面是我的SP元数据的编辑副本:

代码语言:javascript
运行
复制
<?xml version="1.0"?>
<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" entityID="urn:amazon:cognito:sp:us-east-2_[REDACTED]" validUntil="2023-04-04T00:00:00Z">
  <SPSSODescriptor protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" WantAssertionsSigned="true">
    <KeyDescriptor use="signing">
      <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <ds:X509Data>
          <ds:X509Certificate>
            [REDACTED]
          </ds:X509Certificate>
        </ds:X509Data>
      </ds:KeyInfo>
    </KeyDescriptor>
    <NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</NameIDFormat>
    <NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</NameIDFormat>
    <NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</NameIDFormat>
    <AssertionConsumerService index="1" isDefault="true" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://[REDACTED].auth.us-east-2.amazoncognito.com/saml2/idpresponse" />
    <AssertionConsumerService index="2" isDefault="false" Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://[REDACTED].auth.us-east-2.amazoncognito.com/saml2/idpresponse" />
    <AttributeConsumingService index="1">
      <ServiceName xml:lang="en">AWS Vermeer Single Sign-On</ServiceName>
      <RequestedAttribute isRequired="true" Name="mail" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="email" />
      <RequestedAttribute isRequired="false" Name="given_name" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="firstName" />
      <RequestedAttribute isRequired="false" Name="family_name" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic" FriendlyName="lastName" />
    </AttributeConsumingService>
  </SPSSODescriptor>
  <Organization>
    <OrganizationName xml:lang="en">[REDACTED]</OrganizationName>
    <OrganizationDisplayName xml:lang="en">[REDACTED]</OrganizationDisplayName>
    <OrganizationURL xml:lang="en">[REDACTED]</OrganizationURL>
  </Organization>
</EntityDescriptor>

无关StackOverflow问题

EN

Stack Overflow用户

回答已采纳

发布于 2022-04-28 22:00:05

从查看IdP元数据开始。IdP使用IdP私钥签名SAML响应,SP用IdP公钥验证签名。

IdP元数据将包含证书,您可以验证证书是否与SAML响应中的证书匹配。

请详细说明这些密钥是如何工作的,如果有的话,IdP的元数据中的证书如何与SP的元数据中的证书保持一致?

这将是一个标准的公钥和私钥对。用于数字签名时,使用发件人的私钥对消息进行签名,并使用发件人的公钥对签名进行验证。

在SAML交换中,将有一个SAML请求(从SP到IdP)和一个SAML响应(从IdP到SP)。正式而言,签署请求和/或答复是可选的,尽管国内流离失所者/SP可能需要签署。SAML请求通常没有签名(尽管可以签名)。

因此,SAML响应由IDP使用IdP私钥签名,签名由SP使用IdP提供的公钥进行验证。SAML请求将由SP使用SP的私钥签名,并由IDP使用SP提供的公钥进行验证。

IdP元数据中的证书与SP元数据中的证书之间没有任何关系,除了两者都是用于验证数字签名的公共证书之外。

票数 2
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72050391

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档