AWS Cognito creates multiple entries in the user pool when signing in a user with the same email address through the Google and Facebook identity providers. How can I create just one user instead of multiple users and is it possible to automatically combine the entries with AWS Cognito or with AWS Lambda functions?
To create just one user instead of multiple users when signing in a user with the same email address through the Google and Facebook identity providers, you need to enable the same email address in the user pool settings. This can be done by following these steps:
Go to your AWS Cognito user pool dashboard.
Click on “Attributes” in the left-hand menu.
Find the “Email” attribute and click “Edit”.
Check the box next to “Same user can have multiple email addresses”.
Click “Save changes”.
Once this is done, AWS Cognito will allow multiple sign-ins with the same email address and will merge the entries automatically. No additional code or Lambda functions are necessary.