Anyway I can explain what we want to achieve so far and maybe you can suggest us to do it another way or with a workaround the way we want to do it?
We want to send a request to some of our backends whith the generated auth0 user id on passwordless registration in order to return our external user identifier and get it stored into auth0 user profile, in order to have it embedded into the JWT id token. Thus when we do requests thereafter on our own api whith this JWT id token it will embed both auth0 id and our external user id which is the one we care of.
I have done the same when I managed a mobile app with auth0 authentication and connected each user to its CRM’s identifier. for me the connection field was the phone number (for SMS passwordless).
u can use post login Rule - auth0 will call your backend with some fields and get back the external user ID, then save the external user id on the auth0 user metadata.
then if u want to get this data on the IDToken auth inside your JWT you need another rule to save from the user_metadata into the IDTOKEN.
If u need more help I can send u the code… Guy-Avraham.com
Thanks for this example! I’m working with @shouze on an Auth0 integration and it helps us a lot to understand how Auth0 works. We now have an external id attached to our user with a dedicated rule