Raj
Raj

Reputation: 1147

AWS Cognito verification email not received by user account

While creating user in userpool, user invitation messages are sent with a temporary password but email verification messages is not being sent.
I was creating a very simple setup to try out aws cognito service. Here is what I did in AWS cognito, I created a user pool with step by step as follows:
1)What do you want to name your user pool?
-> testpool

2)How do you want to create your user pool?
-> step through settings

3)How do you want your end users to sign in?
->Email address or phone number-Allow email addresses

4)What password strength do you want to require?
->Minimum length=6

5)Do you want to allow users to sign themselves up?
->Allow users to sign themselves up

6)How quickly should user accounts created by administrators expire if not used?
->Days to expire-7

7)Do you want to enable Multi-Factor Authentication (MFA)?
->off

8)Do you want to require verification of emails or phone numbers?
->Email

9)You must provide a role to allow Amazon Cognito to send SMS messages
->testpool-SMS-Role

10)Do you want to customize your email verification messages?
->Verification type-link
->Email subject = Your verification link
->Email message = Please click the link below to verify your email address. {##Verify Email##}

11)Do you want to customize your user invitation messages?
->SMS message = Your username is {username} and temporary password is ->{####}.
->Email subject = Your temporary password
->Email message = Your username is {username} and temporary password is {####}.

12)Do you want to customize your email address?
->no

13)Do you want to add tags for this user pool?
->no

14)Do you want to remember your user's devices?
->no

15)Which app clients will have access to this user pool?
->none(will simulate from create user option in genral setting-user and group)

16)Do you want to customize workflows with triggers?
->no

17)Review page - this page shows summary of whatever I selected Create pool

Now after pool creation went ot genral setting-user and group and clicked create user A Create user pop-up shows:
Username (Required): myEmailAddress
Send an invitation to this new user?: check
Temporary password: left blank
Phone Number: empty(not required)
Mark phone number as verified? unCheck
Email: myEmailAddress
Mark email as verified? unCheck
Click on Create User

A mail is received into my account form [email protected] via amazonses.com,
with subject: Your temporary password
with message as: Your username is [email protected] and temporary password is agsjyk.
This is okay.

But I didnot receive any verification mail link before previous mail.

Upvotes: 10

Views: 29565

Answers (6)

anand
anand

Reputation: 101

With Cognito, if you have added both email and phone number then you should allow both as verification methods(In the SignUp experience Tab) as below: Attribute Verification and Account Confirmation

Otherwise the email verification link or code is not sent

Upvotes: 2

npn_or_pnp
npn_or_pnp

Reputation: 515

If anyone else is facing this issue, it appears that you cannot send verification emails if you use SAML or a federated identity provider. Cognito sets the cognito user to EXTERNAL_PROVIDER and no Cognito API calls allow sending a verifcation code or link. The cognito user is automatically created on initial sign-in. I have my user pool set to validate email address but it is always set to false.

The only way that I know to confirm the user via SSO is to use an external verification process outside of cognito.

Upvotes: 2

live-love
live-love

Reputation: 52366

You need to add a domain in this section of the Incognito Service:

enter image description here

Also, if you are not getting the email, click on the user, and check their email, it could be wrong.

enter image description here

Upvotes: 1

cesarlugoe
cesarlugoe

Reputation: 71

A mail is received into my account form [email protected] via
amazonses.com, with subject: Your temporary password with message as: Your username is [email protected] and temporary password is > agsjyk.

Looking at this it seems you are creating the user via the Cognito API by the AdminCreateUser method, and that's why you are receiving a temporary password.

The confirmation email you are expecting will only be sent if the user registers itself, so you should use the SignUp method.

Upvotes: 7

user2426598
user2426598

Reputation: 314

Not sure if you're missing this particular setup....Domain name is require for link verification. Under "Tab integration" then "Domain name"

Upvotes: 12

Summer Guo
Summer Guo

Reputation: 279

verification mail link is for when users sign themselves up, they will receive a link to ask them to verify the email address instead of a code. In your case, you are send a temporary password to the user, so the link wont show up.

Upvotes: 1

Related Questions