AdminUpdateUserAttributesRequest request = new AdminUpdateUserAttributesRequest();
AttributeType data = new AttributeType();
data.setName("email");
data.setValue(email);
request.withUserAttributes(data);
request.withUserAttributes(
new AttributeType().withName("email").withValue(email),
new AttributeType().withName("email_verified").withValue("true")
);
request.withUsername(userName);
request.withUserPoolId(userPoolID);
cognitoClient.adminUpdateUserAttributes(request);
I am using above code to update email of the existing cognito pool user. Code works for the user pool created in "eu-west-2" region, but I have created a new new pool in "eu-north-1".
For the newly created user pool I am getting error as "Invalid user attributes: email: Attribute cannot be updated - AWSCognitoIdentityProvider". I have cross checked both User pool attributes, I can't able to find what I have missed while creating this user pool.
Any ideas, why Cognito is not allowing me to update default "email" attribute value of the existing users
Not exactly identified the problem and found that Cognito released beta version of User pool in region "eu-north-1". So I have again changed the User Pool location to "eu-west-2", nothing else changed. Works fine in this region