I recently started using the AWS Amplify CLI. The default authentication when using AWS Amplify is username, email and phone number. I didn’t want to use a username. After googling and filing an issue I found out that this feature is currently not supported. Bummer 🙄

But, there is a way doing it semi-manually! 👏🏻

It requires one little step (two if you are on React and want to use Amplify’s UI components).

Configure the Auth Settings

Run amplify add auth .¹ Next, in your generated <weird-number>-cloudformation-template.yml in the directory amplify/backend/auth/<weird-number>/ add

UsernameAttributes:

- 'email'

to the file. I made a screenshot to show you where it belongs:

✋🏻 Manual labor 🔨

This will configure the Cognito user pool in the right way.

For a full list of possible values you can find the AWS Cognito docs here.

(Optional) Configure the UI Components

If you are using the withAuthenticator HOC, add the following code:

This will tell Amplify to omit the username field. Check out the docs for more info - for example if you want to use <Authenticator /> with custom components or how to do this with Angular.

Unfortunately the sign in component now still displays username and an <input type=”name”/> instead of type=”email” . But it will correctly sign up users using the email. This could confuse users. The only way to fix this is by using a custom component.