自定义 SAML 应用程序出现 AWS SSO“无访问错误”

Mad*_*deo 2 amazon-web-services single-sign-on saml-2.0

我正在尝试使用 AWS SSO 设置自定义 SAML 2.0 应用程序。但是,我从网络选项卡中收到以下错误:

Status code 403
{"message":"No access","__type":"com.amazonaws.switchboard.portal#ForbiddenException"}
Run Code Online (Sandbox Code Playgroud)

UI 中显示的是这个:

在此输入图像描述

可能导致此错误的两个注意事项:

  1. 我的 SP 测试服务器正在本地主机中运行
  2. 我正在使用自签名证书:
openssl req -x509 -newkey rsa:2048 -keyout myservice.key -out myservice.cert -days 365 -nodes -subj "/CN=localhost:9000"
Run Code Online (Sandbox Code Playgroud)

如果这仍然没有告诉您任何信息,那么我将在下面描述更多内容。


更多细节

这是来自我正在使用的库的服务器代码

Status code 403
{"message":"No access","__type":"com.amazonaws.switchboard.portal#ForbiddenException"}
Run Code Online (Sandbox Code Playgroud)

该服务器公开一个端点,IDP 可以在其中获取我自动生成的元数据。

curl -o metadata.xml http://localhost:9000/saml/metadata
Run Code Online (Sandbox Code Playgroud)

这些是我的元数据:

<EntityDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" validUntil="2021-09-13T03:37:23.951Z" entityID="http://localhost:9000/saml/metadata">
  <SPSSODescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" validUntil="2021-09-13T03:37:23.951204335Z" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" AuthnRequestsSigned="false" WantAssertionsSigned="true">
    <KeyDescriptor use="encryption">
      <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
        <X509Data>
          <X509Certificate>xxxxxxxxxx</X509Certificate>
        </X509Data>
      </KeyInfo>
      <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"></EncryptionMethod>
      <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes192-cbc"></EncryptionMethod>
      <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"></EncryptionMethod>
      <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"></EncryptionMethod>
    </KeyDescriptor>
    <SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://localhost:9000/saml/slo" ResponseLocation="http://localhost:9000/saml/slo"></SingleLogoutService>
    <AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="http://localhost:9000/saml/acs" index="1"></AssertionConsumerService>
  </SPSSODescriptor>
</EntityDescriptor>
Run Code Online (Sandbox Code Playgroud)

我已将它们上传到 AWS SSO 并且它正确解析了它,我的 AWS SSO 自定义应用程序的配置如下:

在此输入图像描述

当我点击时,localhost:9000/hello应用程序将成功重定向到 AWS SSO 登录控制台,但发生了该错误。我还使用此网站测试了该应用程序:https://samltest.id/upload.php,它运行良好。

Mad*_*deo 9

我找到了解决方案,问题出在属性映射中,这是我必须使用的配置才能使其工作。

在此输入图像描述

注意transient格式选项,在我之前的配置中它是unspecified