Cognito email verification not being sent

Kyle Cooley :

I'm experimenting with Cognito but I can't seem to figure out how to get Cognito to send a verification email to a user for them to verify their email address.

This is in my back-end server, where I've received the username, email, and password from a new user. I'm suppressing the message action because I don't want users to receive a temporary password. Instead, I want to set the password to what they've already provided me.

AdminCreateUserRequest adminCreateUserRequest = new AdminCreateUserRequest().withUserPoolId("<user pool ID>")
                .withUsername(registerUserRequest.getUsername())
                .withUserAttributes(new AttributeType().withName("email")
                        .withValue(registerUserRequest.getEmail()), new AttributeType().withName("email_verified")
                        .withValue("false"))
                .withMessageAction(MessageActionType.SUPPRESS);
awsCognitoIdentityProvider.adminCreateUser(adminCreateUserRequest);

AdminSetUserPasswordRequest adminSetUserPasswordRequest = new AdminSetUserPasswordRequest().withUserPoolId(<user pool ID>)
                .withUsername(registerUserRequest.getUsername())
                .withPassword(registerUserRequest.getPassword())
                .withPermanent(true);
awsCognitoIdentityProvider.adminSetUserPassword(adminSetUserPasswordRequest);

However, users are never receiving an email to verify their email address. In the user pool configuration, I have "Email" selected under "Which attributes do you want to verify?" and I've verified the email address I'm sending from in SES. Am I missing something here?

F_SO_K :

If you use AdminCreateUser the account will always be created with a temporary password.

What you actually want is Signup.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=108861&siteId=1