Skip to content

Signup without required attributes results in a successful signup #431

@meirzadotcom

Description

@meirzadotcom

Hi,

I created a user pool with the following options:

"Options": {
  "SchemaAttributes": [
    {
      "Name": "preferred_username",
      "AttributeDataType": "String",
      "DeveloperOnlyAttribute": false,
      "Mutable": true,
      "Required": true,
      "StringAttributeConstraints": {
        "MinLength": "0",
        "MaxLength": "2048"
      }
    },
    {
      "Name": "email",
      "AttributeDataType": "String",
      "DeveloperOnlyAttribute": false,
      "Mutable": true,
      "Required": true,
      "StringAttributeConstraints": {
        "MinLength": "0",
        "MaxLength": "2048"
      }
    },
    {
      "Name": "phone_number",
      "AttributeDataType": "String",
      "DeveloperOnlyAttribute": false,
      "Mutable": true,
      "Required": true,
      "StringAttributeConstraints": {
        "MinLength": "0",
        "MaxLength": "2048"
      }
    }
  ],
  "UsernameAttributes": [
    "email",
    "phone_number"
  ],
}

As you can see, email address, preferred username, and phone number are required. However, when I sign up a user with only an email address, without a phone number or preferred username, the signup process still succeeds.

aws --endpoint http://localhost:9229 cognito-idp sign-up \
  --client-id 6c5pnuyug5d5evecuhc84hnwq \
  --username [email protected] \
  --password "Password123" \
  --user-attributes \
      Name=email,[email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions