To create a user through self-signup and self-confirmation, observe the following steps:
- Create an app client for our user pool. The user pool should support email verification:
aws cognito-idp create-user-pool-client
--user-pool-id us-east-1_cRtc8peWU
--client-name UserPoolClientForSignUp
--profile awssecadmin
We should get the following response:
- Create a user account through signup, providing an email:
aws cognito-idp sign-up
--client-id 5r4f3tpvi026j51atur29uqlme
--username testuser3
--password Passw0rd$
--user-attributes Name=email,[email protected]
We should get the following response:
We should also get a confirmation code via email, shown as follows:
- Self-confirm the account with the confirmation code received:
aws cognito-idp confirm-sign-up
--client-id 5r4f3tpvi026j51atur29uqlme
--username testuser3
--confirmation-code 923042
We can now log in with this user using any of the authentication flows, such as admin authentication (server-side) or client-side authentication flows (using SRP or a password with a username), while using an appropriate app client.