-
Notifications
You must be signed in to change notification settings - Fork 451
Link identities from different Federated providers #560
Comments
You would have to call the 'admin link provider for user' from your backend to link them based on common attributes. |
Ok, I see. Thanks for the link |
@dbeja @itrestian Any solid examples of adminLinkProviderForUser? The documentation is on the difficult side to follow. Is it possible to link an unconfirmed pooluser with a google or a fb account? |
@prem911 The documentation is confusing however the answers are there. I find consulting the AWS REST API docs (what all the SDKs call) far more useful than the SDK docs. I used these params to link a Facebook account to a email/password account in my user pool. Note you do this before the Facebook account has been created (more on that below) otherwise you will receive a
If I pass these params to a call to adminLinkProviderForUser I get an empty Following that I can sign in with my Facebook account and see that no new Facebook account is created in my pool (yay). After I generate keys for the user that has just logged in and I decode the @itrestian This all looks good, however the linking relies on using a value in the id, sub, or user_id value found in the social identity provider token. So how is the flow supposed to work? I can't get that info until someone goes through the oauth flow with a provider. How can I hook into that flow, get the id, sub, or user_id to perform the linking? In order to do the social login I'm doing the |
I'm in the same boat as @saintberry When no errors occur, I end up with two users (UserPassUser + GoogleUser) and additionally the UserPassUser now has an "identity" field that contains the Google user data. Is there a way to prevent that extra user from being created? Is there a better place to put this code in the Cognito trigger/lifecycle flow? |
@iDVB @saintberry did you figure out the flow? Did you find a more appropriate trigger that provides the id of the federated user account? Is there anything between |
Darn it, I think I found it: directly in the event object, there is Anyone else faced this? (Just as a reference, I call Posted this here if anyone interested: https://stackoverflow.com/q/47815161/592641 |
Hi,
I'm using a federated pool with a user pool and some social providers (Google, Facebook).
What should be the approach to link identities if they connect using different providers (the same email in all providers)?
Thanks!
The text was updated successfully, but these errors were encountered: