[英]AWS Cognito User Devices Trigger
We use AWS Cognito for user authentication.我们使用 AWS Cognito 进行用户身份验证。 Every user can have multiple devices.
每个用户都可以拥有多个设备。 We would like to react to newly registered or deleted devices for every user.
我们希望对每个用户的新注册或删除设备做出反应。 Ideally through a lambda trigger.
理想情况下,通过 lambda 触发器。 How can we archieve that?
我们怎样才能存档呢?
These standard triggers won't work for our usecase: Customizing User Pool Workflows with Lambda Triggers这些标准触发器不适用于我们的用例: Customizing User Pool Workflows with Lambda Triggers
Does anyone have sugguestions how to tackle that problem?有没有人建议如何解决这个问题?
Step1: In AWS Cognito you net to enable the end-user device tracking as mentioned in the below document.第 1 步:在 AWS Cognito 中,您可以按照以下文档中的说明启用最终用户设备跟踪。
https://aws.amazon.com/blogs/mobile/tracking-and-remembering-devices-using-amazon-cognito-your-user-pools/ https://aws.amazon.com/blogs/mobile/tracking-and-remembering-devices-using-amazon-cognito-your-user-pools/
Step2: Every authentication attempt for the user, you can create an SNS message with the device info and user info. Step2: 用户的每次认证尝试,您都可以使用设备信息和用户信息创建一条 SNS 消息。
Step3: Push this message into a SQS so that it can trigger a AWS Lambda步骤 3:将此消息推送到 SQS,以便它可以触发 AWS Lambda
Step4: Process the message and respond to the user according to the required logic. Step4:处理消息并根据需要的逻辑响应用户。
I hope this helps.我希望这有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.