how to get OTP for all Cognito user's ?

0

I am using the AWS cognito user pool, where users can enter their phone numbers or email-based login. While the users log in with their email or phone number, they will receive an OTP with both their phone number and email. Only registered phone numbers and emails at AWS SNS and SES can receive an OTP.

This will happen based on AWS Cognito user-pool lambda triggers(Create auth challenge, Define auth challenge, and Verify auth challenge).

Now my problem was that every Cognito user, while logging in, couldn't receive OTP because they didn't register in SNS or SES. They are the only registered users in the Cognito user pool.

How could we change that?

while every user, while logging into their email or phone number, must receive an OTP to their respective input value (like email or phone number).

1 Answer
0
Accepted Answer

Thank you for reaching out us regarding the above query.

While configuring Auth category in Amplify with OTP based authentication, I could observe that it throws an warning message after the push operation as - "⚠️ You have enabled SMS based auth workflow. Verify your SNS account mode in the SNS console: https://console.aws.amazon.com/sns/v3/home#/mobile/text-messaging If your account is in "Sandbox" mode, you can only send SMS messages to verified recipient phone numbers."

Therefore, could you please check if your SES and SNS account mode is out of Sandbox mode or not. This is because "Sandmox" mode in SES and SNS has some restriction and it allows only verified recipents. However, if they are in Production then, you would be able to send messages.

[+] SNS : https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html [+] SES : https://docs.aws.amazon.com/ses/latest/dg/request-production-access.html

Having said that, in case you face further challenges, please feel free to open a support case with AWS using the following link.

AWS
SUPPORT ENGINEER
answered 10 months ago
profile picture
EXPERT
reviewed 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions