Which Category is your question related to?
Authentication
What AWS Services are you utilizing?
Amazon Cognito Hosted UI
Provide additional details e.g. code snippets
In my app, I have Amazon Cognito Hosted UI configured to handle Authentication by email and social (facebook and google).
_The problem:_
When a user create an account by email (ex: gmail) and later sign up by social (ex: same gmail), I have two accounts created in Cognito.
_Question:_
How merge these two accounts created with the same email?
The API you need to use is adminLinkProviderForUser, I believe.
I don't think Amplify currently has a built-in federation mechanism, i.e. automatically calling adminLinkProviderForUser when a Cognito-authenticated user signs in through social provider.
This is potentially a candidate for Triggers or Admin Queries as part of the following RFC: https://github.com/aws-amplify/amplify-cli/issues/766
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This feature request needs to be maintained open until it's delivered with RFC: aws-amplify/amplify-cli#766
What's the current solution to this? Is it running a Lambda using a pre-signup trigger and AdminLinkProviderForUser?
@ricky-sb that was my thought eight months ago, at least, when it was a bit fresher. I will say though that I think if you have separate identities for a single user and you want to federate them silently on the backend, AdminLinkProviderForUser is the correct API to hit.
@johanrin Cognito Lambda Triggers are now configurable via Amplify CLI. Closing this request as the RFC is closed and the request is complete.
Most helpful comment
This is potentially a candidate for Triggers or Admin Queries as part of the following RFC: https://github.com/aws-amplify/amplify-cli/issues/766