I am developing native iOS and Android apps using Firebase Realtime Database as a backend and for now, Firebase Authentication as an identity provider. So right now, when a user signs up, I create a user in Firebase Auth and a user profile linked to it in Firebase Realtime Database.
Now I want to switch to an Azure AD B2C behind Auth0 for my authentication needs. I already checked that I was able to sign in users that already exist in Azure B2C using Auth0. So the connection is configured and it works. But I’m trying to figure out the best strategy for users signing up.
My first approach was to use Azure AD B2C’s APIs directly to create a user, then get a user identifier from that and create the user profile in Firebase, then let the user sign in using Auth0, but that defeats the purpose of using Auth0 in the first place, which is to hide the reality of the identity provider behind a generic layer provided by Auth0.
Now I’m thinking I could also implement just sign in with Auth0, but then configure Azure AD B2C’s authentication form in order to display a “No account yet? Sign up here” kind of link, so that users can sign up with Azure AD B2C directly from the web part of the process, then whatever the case let Auth0 return me some user ID and check in my database if I have a user profile for that user ID, and if not, create it and be done.
Is that possible? Has anybody done that already? Is there a better strategy?