【问题标题】:AWS user pool authentication with external OIDC IdP使用外部 OIDC IdP 的 AWS 用户池身份验证
【发布时间】:2019-05-08 13:46:57
【问题描述】:

我正在为应用程序开发节点/express 后端。身份验证过程已使用 Auth0 和护照设置。但是我们现在需要使用 AWS...

我已遵循这些文档并成功测试了文章末尾引用的自定义端点:https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-oidc-idp.html

但我想从这里连接到身份池以访问 AWS 服务。我不断收到错误,虽然我可以看到 AWS“用户池”中的用户,但他们没有出现在 AWS“身份池”中。

我正在使用以下方式调用 AWS:

AWS.config.credentials = new AWS.CognitoIdentityCredentials({
     IdentityPoolId: IDENTITY_POOL_ID,
     Logins: {
       "cognito-idp.<region>.amazonaws.com/<user-pool-id>":
         id_token_from_provider,
     },
   })

我不断收到的主要错误是“登录令牌无效:发行者与提供者 ID 不匹配”。

感谢任何帮助...

【问题讨论】:

    标签: amazon-web-services amazon-cognito openid-connect


    【解决方案1】:

    经过更多挖掘:通过 Auth0 找到了这个不错的演练,https://auth0.com/docs/integrations/integrating-auth0-amazon-cognito-mobile-apps

    我已跳过用户池集成,只是将 cognito 用于“身份池”

    我的凭据映射也发生了一些变化:

     AWS.config.credentials = new AWS.CognitoIdentityCredentials({
        IdentityPoolId: "IDENTITY_POOL_ID",
        Logins: {
          "<PROVIDER_NAME_FROM_IAM": id_token,
        },
      })
    

    【讨论】:

      猜你喜欢
      • 2020-08-14
      • 2022-11-11
      • 2022-06-16
      • 2022-01-26
      • 1970-01-01
      • 2018-05-08
      • 2022-06-23
      • 2019-02-11
      • 2019-10-26
      相关资源
      最近更新 更多