Cognito - signup request doesn't use the given username but a UUID

Viewed 3738

Not sure what is missing, but when I use the signup request, a user is created in my cognito user pool with a UUID user name (actually the sub attribute value) and not the email.

val signup = new SignUpRequest()
  .withUsername(user.email)  // <- cognito ignore this, and use a UUID for username
  .withClientId(clientId)
  .withSecretHash(secret)
  .withPassword(user.password)
  .withUserAttributes(List(email, givenName, familyName))

Looking in the documentation a UUID is used when the value of the email is not valid.

The email I use looks similar to this: roc.roc+test@foo.com (which is a valid email)

BTW, when I use the AdminCreateUserRequest api, it get created with the email as the username as expected.

val createUser =
  new AdminCreateUserRequest()
    .withUsername(user.email)
    .withUserPoolId(cognitoUserPoolId)
    .withUserAttributes(attributes)

client.adminCreateUser(createUser)

Edit: Now with snapshots:

This is using the signup api - image

And this is using the create user api:

image

Only the sign up doesn't work, What did I miss?

1 Answers
Related