I am trying to integrate AWS Cognito with a third-party SAML SSO Identity Provider. The third-party IdP is responding with a successful SAML assertion upon login.
Cognito then attempts to validate the assertion's signature, but fails with the following error message:
Error in SAML response processing: SAML Assertion signature is invalid
How can I diagnose the cause of Cognito's assertion processing?
We've tested our Cognito SP with samltest.id, which fully works.
Reading samltest.id's FAQ, signature verification errors from Shibboleth (unrelated to my solution) usually means that the key "used to sign the assertion doesn’t match any valid key with either usage="signing"
or null usage in your IdP’s metadata."
Here is a redacted copy of my SP metadata:
<?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>