4

I am building an app that will be using Plivo or Twilio for user interaction and input.

I wanted to use AWS Cognito for user management, but for verification, they say a user must verify email or phone number.

I wanted to have the user interaction and verification come from the same phone number, so is there a way to set this up in Node.js somehow, where a text to a Plivo/Twilio number reroutes to AWS Cognito for verification?

Alex Baban
  • 11,312
  • 4
  • 30
  • 44
VDog
  • 1,083
  • 2
  • 13
  • 35

2 Answers2

7

Looking at the document, it seems that it is now possible to send emails and SMS using a third party. It is unknown when it was released.

Custom Sender Lambda Trigger

https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-sender-triggers.html

Custom SMS Sender Lambda Trigger

https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-sms-sender.html

Custom Email Lambda Trigger

https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-custom-email-sender.html

konishi.keisuke
  • 116
  • 1
  • 3
4

You can leverage the custom auth flow to achieve this. Take a look on a example article we have here: https://aws.amazon.com/blogs/mobile/customizing-your-user-pool-authentication-flow/

The idea is that you will explicitly do the calls you want to Twilio/Plivo from the lambda function.

Cognito UserPools does not intergrade out of the box with a third party. And offers its own notification mechanism through SNS and SES services. I would consider this option as well in your position.

Vasileios Lekakis
  • 5,492
  • 2
  • 15
  • 17
  • so I would add sms sending logic in pre signup. what should I set in response verifyPhone ? as I cannot accept the signup nor deny it but wait till otp is send back by user – Yusuf Jan 10 '21 at 10:02