- Newest
- Most votes
- Most comments
Great questions! Let's break down your scenario and address each point:
1. SignIn with Both Email and Phone Number
If you configure AWS Cognito to accept both email and phone number for SignIn but require only the email attribute for SignUp, users will still be able to register and log in using either their email or phone number. This is because Cognito allows flexibility in SignIn options, and you can configure it to accept multiple identifiers for authentication.
2. User Storage in Cognito Database
When users register, even if they only provide an email during SignUp, they can later add a phone number to their account. Cognito will store both attributes and associate them with the same user account. This means that users can log in using either their email or phone number, and Cognito will correctly identify and authenticate them.
Handling Third-Party Authentication
Regarding the issue with Facebook authentication, the error occurs because Cognito expects a phone number if it's set as a required attribute. By configuring Cognito to require only the email for SignUp, you should be able to integrate Facebook authentication without issues. This setup will allow users to SignIn with either their email or phone number, even if they initially registered using Facebook (which doesn't provide a phone number attribute).
Relevant content
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago