Reputation: 1633
AWS Cognito works pretty well in our environment, we have roughly 7000 users.
However we have customers who cannot seem to find the verification emails that get sent out (and they have no idea what a spam folder is).
Is there a way as admin to email_verify them? Is there a way as admin to reset their password (and enter their new password for them) without a verification email?
I can't seem to find the right methods in the AWS Java SDK's AWSCognitoIdentityProviderClient.
Upvotes: 1
Views: 514
Reputation: 1874
You can call adminUpdateUserAttributes
if you have access to the admin API. It is not explicitly documented, but email_verified
is an attribute you can update.
Eg. Using the javascript aws sdk:
var params = {
UserAttributes: [ /* required */
{
Name: 'email_verified', /* required */
Value: 'true' //NEEDS TO BE A STRING
},
/* more items */
],
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminUpdateUserAttributes(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Upvotes: 1
Reputation: 5775
Unfortunately, Cognito can't solve this problem directly. Currently, Cognito does not allow the developers to update the email_verified and phone_verified attributes. The only way these can be marked as true is through the code verification process. One workaround could be to use phone numbers instead of email addresses for verification.
Upvotes: 0