I created a user pool in AWS’s Cognito, specified given_name
and family_name
as required user attributes. I also added an app and checked the permissions :
If – using the Cognito Identidy SDK – I try to register a user and omit the attributes, I get: "Attributes did not conform to the schema: given_name: The attribute is required family_name: The attribute is required" which is expected.
If I include the attributes:
const firstNameAttribute = new CognitoUserAttribute({ Name: 'first_name', Value: firstName });
const lastNameAttribute = new CognitoUserAttribute({ Name: 'last_name', Value: lastName });
cognitoUserPool.signUp(username, password, [firstNameAttribute], [lastNameAttribute], callback);
The server returns
{
"__type":"NotAuthorizedException",
"message":"A client attempted to write unauthorized attribute"
}
How can I fix this and let users set their name during registration?
2
Answers
The app in which the users would try register sent the wrong field names :(
You have to check Write permission is allowed in app client.
Location: