amazon-web-servicesflutteramazon-cognitoaws-amplifyflutter-aws-amplify

Flutter AWS Auth: How to get custom user attribute?


How do I get in Flutter, the cognito custom user attribute for user?

await Amplify.Auth.fetchUserAttributes();

returns only user attributes but not the custom defined ones.

(I have added the attribute to the schema and I am sure it's there, in the AWS UI it's there.)


Solution

  • The issue was that these custom attributes, after they are created, they are not by default readable or writable.

    For further explanations, check https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#user-pool-settings-attribute-permissions-and-scopes Go to cognito - app clients - details - and very bottom to change permissions

    Go to cognito - app clients - details - and very bottom to change permissions