Providing username values while importing users to Cognito

0

I'm using Cognito user pool created with Amplify. It requires e-mail sign-in and sign-up. Username parameter is automatically filled with sub value.

I'm using this username value as a unique id for Dynamo DB user table. I've selected username value as a unique id since sub values were assigned by Cognito system, we could not provide them. It's also explained in Cognito docs: "If your application doesn't require a user name, you don't need to ask users to provide one. Your app can create a unique username for users in the background. This can be useful if you want users to register and sign in with an email address and password." https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html

While importing users to new Cognito pool (same configuration with Amplify), I was hoping to copy the username values to cognito:username attributes of newly created users. But it didn't work like that, import job failed with "Username should be an email". Even when I provide email for username attribute, it's set as a random UUID.

I do not understand, how these users were created with usernames keeping sub (UUID) values, if it's not allowed? If they could be created with these values, why they can't be imported to a new user pool having exactly the same config, any idea?

Kashmir
demandé il y a 2 ans97 vues
Aucune réponse

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions