Search code examples
amazon-web-servicesamazon-cognitoamazon-sns

Why is AWS Cognito (SNS) not sending message to verify user attribute?


I am having trouble getting SNS to send a verification code when I am trying to verify a user attribute. In this case, I am trying to verify a user's phone_number.

My SNS account is in sandbox mode; I have verified that I'm able to successfully send myself a test SNS message from the AWS console.

When making the request from within my app (node) I am getting the following 200 response:

{
    "CodeDeliveryDetails": {
        "Destination": "+*******1234",
        "DeliveryMedium": "SMS",
        "AttributeName": "phone_number"
    }
}

Although I don't actually ever receive a text message. I have seen that a possible solution is to increase the spend limit. However, this is the first few messages I've sent so I don't think that is my issue.

I can see in the SNS page that I have 4 messages sent, 3 failed (the successful was my test message). Is there a place to look at logs within the SNS context?

How can I find out why my messages aren't sending when making a seemingly successfuly request to cognitoIdentityServiceProvider.verifyUserAttribute


Solution

  • Following up here, Arpit Jain really helped point me in the right direction. Because I was in sandbox in my AWS SMS account, I could only send to my verified phone number.

    I had my number verified within my sandbox, but because of some recent regulation updates (please correct me if I am wrong), I need to verify my toll-free number (the number sending my verification code) within Pinpoint.

    Pinptoint provides a toll-free registration form that I needed to fill out and provide my use case. It took a bit, but once it was approved, I am now successfully receiving the verification code from Cognito.