Search code examples
node.jsamazon-web-servicestwilioamazon-cognitoplivo

How can I use cognito to create user accounts, but a different service for verification?


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?


Solution

  • 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.