I was in a similar situation, so here is a good starting point for you:
You might want to merge in the Accounts.onCreateUser event. Basically what you would do at this time:
Make the required protocol / routine to save the email in any profile field in any authentication method, as far as possible so that you can take the next step that ...
Whenever a different authentication method is used (to create a user), you can compare the existing user database (now you are sure that the email field will always be present to check), and merge the exact match of the email every time.
I am ashamed that I donβt have the code now, because I tried this protocol once, but I quickly decided that for some reason I was just using a single authentication method. Maybe I will update this answer when I can get around to try again, or maybe not.
source share