I have Cognito setup with login supported from multiple identity providers (Cognito User Pools, Facebook, and Google). In my User Pool configuration I have email used as username. The desired functionality is to have username be unique across all identity providers. i.e. if a user logs in with Facebook and their facebook email is "user@test.com" and then they login with Google and their google email is "user@test.com", either they should not be able to login or their federated identities should be merged.
This is user management for connected devices. I don't want a user to setup a few devices while logged into Facebook, then login with Google and not be able to see their devices from their Facebook account.
I know this gets complicated since you can create a Facebook account with just a phone number.
I know there is a pre-authentication trigger in Cognito User Pool's, but it doesn't seem to be triggering when I login with a federated identity. Is there a trigger than I can use that will fire no matter which identity provider I use (User Pool, Facebook, Google)?
Thanks,