【问题标题】:Post Authentication custom response to client from Cognito从 Cognito 向客户端发布身份验证自定义响应
【发布时间】:2019-05-12 08:59:40
【问题描述】:

我们在 Cognito 中设置了 lambda 触发器,用于预身份验证/身份验证后和后确认。
在所有触发器中,我们正在检查我们的 DynamoDB 以便继续,并且 db 条目按预期正确出现。
但是,我们还希望在登录时将数据库中的一些详细信息发送回客户端。
在本例中,它是一个包含我们 DynamoDB 用户 uuid 的用户对象。

我们的 iOS 开发人员正在使用 AWSAuthUIViewController,并希望在此处访问我们的自定义响应:

AWSAuthUIViewController
.presentViewController(with: self.navigationController!,
              configuration: config,
          completionHandler: { (provider: AWSSignInProvider, error: Error?) in
                                 //...

                                 let user = AWSCognitoUserPoolsSignInProvider
                                           .sharedInstance()
                                           .getUserPool()
                                           .currentUser()

                                           /*
                                              do something to access custom 
                                              response of user object
                                            */
})

我们查看了Custom Message Lambda Trigger documentation,但这个与 MFA 相关,所以它不是我们要寻找的。​​p>

主要问题是如何让 Cognito 使用包含我们 DynamoDB 条目的自定义对象响应客户端。

【问题讨论】:

    标签: ios swift amazon-web-services aws-lambda amazon-cognito


    【解决方案1】:

    更好的使用流程可能是Custom Authentication Flow。 AWSAuthUIViewController 不支持它,但您可以使用 AWSCognitoIdentityUserPool 来执行流程。在结束流程之前,可以利用自定义质询将信息传回给客户端。

    【讨论】:

      猜你喜欢
      • 2019-03-12
      • 1970-01-01
      • 2018-06-03
      • 2015-07-27
      • 2021-08-17
      • 2021-05-05
      • 1970-01-01
      • 2016-11-14
      • 1970-01-01
      相关资源
      最近更新 更多