skip to Main Content

What I want to achieve is to have a completely obfuscated value in Firebase Authentication Identifier, which is to be used only to verify that a user is authenticated and get the correct UID to work against firestore.
No need for reset password or such features, because I would use an external identity provider (like Auth0), although user migration and preserving old data will be a thing to face eventually.
So ideally in Firebase Auth I would like to see something like:
Identifier: 9fh4h4gt (Auth0 UID)
User UID: dnv7824h024 (id used to link the user in firestore)

I know from several years old answers like this that it was not possible to have custom values in the Identifier field in Firebase Authentication, and I could not find any new statement contradicting that, therefore I ask again because after so many years (and a number of requests for this use case), the limitation might have been lifted.

I tried to get a token with only openid claim, without email and profile, but the Firebase Android SDK (startActivityForSignInWithProvider) hardcodes them apparently.
So I tried to use manual calls to authenticate and get the token from Auth0 first, but I always got one or the other issue, like MISSING_IDENTIFIER when directly using it with signInWithCustomToken, not valid nonce when using signInWithCredential, or some unspecified internal server error on Auth0 side when trying to use directly the AuthenticationAPIClient.login.

2

Answers


  1. I know from several years old answers like this that it was not possible to have custom values in the Identifier field in Firebase Authentication, and I could not find any new statement contradicting that, therefore I ask again because after so many years (and a number of requests for this use case), the limitation might have been lifted.

    No, it is still not possible to change (obfuscate) the value of the UID in the Firebase Authentication once is generated. So you can continue to file a feature request or suggest it on uservoice.

    Login or Signup to reply.
  2. If you’re using an external identity provider, consider implementing a customer provider in Firebase for it. That way, you can use the Auth0 ID of the user as the UID in Firebase.

    To use the Auth0 token in Firebase you’ll need to mint a Firebase ID token based on the information in the Auth0 token, and then sign the user into Firebase with that.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search