【发布时间】: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