InvalidParameterException: Cannot modify the non-mutable attribute identities

0

InvalidParameterException: Cannot modify the non-mutable attribute identities

I get above error while calling Auth.updateUserAttributes(user, attributes) function using amplify sdk for react native even though i am not trying to update this attribute. problem occurs only with users loging in using federated identity (well since only them actually have identities attribute set) have anyone else encountered this problem ? any advice ?

asked 5 months ago177 views
1 Answer
0

Can you console log what attributes you are trying to update? From the error you must have passed some attributes that are not supposed to be changed like email or similar.

Also Auth.updateUserAttributes expects that before you called Auth.currentAuthenticatedUser, in that case the user used as argument will be updated as a side effect with current user.

profile picture
EXPERT
answered 5 months ago
  • so since i assumed properties that doesn't change just won't even attempt to be updated at first i tried to just pass whole object that looked like this { "sub": "<user id>", "identities": "[<your usual default config here>]", "email_verified": false, "email": "<email>, "name": "Aaa", "picture": "image.jpg" }

    than i tried sending this

    { "sub": "<user id>", "email_verified": false, "email": "<email>, "name": "Aaa", "picture": "image.jpg" } that didn't worked either so i just sent this: { "name": "Aaa" } and it still doesn't work, can you tell me what i might be doing wrong ? i am passing user gathered from Auth module and no matter what i try to update cognito screams at me that i can't update identities attribute, any ideas what might be wrong here ?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions