I am trying to normalise Auth0 users when they sign up. Basically our users can sign up with email/password or Gmail or Facebook. We want to have Username-Password-Authentication as primary identity for every user even if they sign up with Gmail or Facebook.
Here’s what I want to do (in Auth0 rule):
- Let’s say users sign up using Gmail. And we create another Auth0 user using their email and a generated password.
- Then we link the user with Gmail and the user with email/password. The email/password one should be the primary identity.
- As the user_id changes we need to sign in with the email/password user so we get the id_token.
My question is how can I return the new id_token (in Auth0 rule) so that the id_token we get in our SPA is for the email/password user, not the initial Gmail user.