[英]AWS Cognito: Test triggers using postman
I am very new to AWS and I am trying to implement passwordless authentication.我是 AWS 的新手,我正在尝试实施无密码身份验证。 I have created an user pool and has implemented triggers for phone & OTP authentication in AWS Cognito by following this tutorial: https://youtu.be/m8DE5ZV4FG4我创建了一个用户池,并按照本教程在 AWS Cognito 中实现了电话和 OTP 身份验证触发器: https://youtu.be/m8DE5ZV4FG4
I created an user using the Hosted UI in the App Client Settings in AWS Cognito.我在 AWS Cognito 的应用程序客户端设置中使用托管 UI 创建了一个用户。 But unfortunately I didn't receive any OTP in the number which was used to sign up.但不幸的是,我没有收到用于注册的号码中的任何 OTP。 Is this the right way to test it?这是测试它的正确方法吗? Is there a way to test the triggers without using AWS Amplify, for eg: by using another software like Postman?有没有办法在不使用 AWS Amplify 的情况下测试触发器,例如:通过使用其他软件,如 Postman?
Just calling those lambdas will not trigger user creation, or confirmation.仅调用这些 lambda 不会触发用户创建或确认。 User creation happens if a user calls the Cognito signup apis and:如果用户调用 Cognito 注册 API 并且:
All you could do with postman was expose your lambda trigger(s) through something like API Gateway, and pass in various payloads to see if it responds correctly.你对 postman 所能做的就是通过类似 API 网关的东西公开你的 lambda 触发器,并传入各种有效负载以查看它是否正确响应。 that is one way to do it..这是一种方法..
Personally what i do to validate triggers is write unit tests that run when the trigger deploys that tests out various payloads to the triggers against an expected response.就我个人而言,我为验证触发器所做的工作是编写在触发器部署时运行的单元测试,根据预期响应测试触发器的各种有效负载。
I'm not sure what language you're writing the lambda in, but any would have SDK's available to call Cognito directly to sign up a user.我不确定你用什么语言编写 lambda,但任何语言都可以使用 SDK 直接调用 Cognito 来注册用户。 That would in turn call your trigger.那会反过来调用你的触发器。 await Cognito.signUp({... })
for me in node.在节点中为我await Cognito.signUp({... })
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.