How to deal with "auth/missing-identifier" error in Firebase?

Viewed 236

I am trying to create a simple web app in node.js (backend only), which would store some user data on Firestore. I want to use my own credentials management, and I believe that signInWithCustomToken() should be my ticket to ensure different users can't access each other's data. The problem however is that if I run

const firebaseAuth = getAuth(app)
// authToken is a jwt token created by my backent
const response = await signInWithCustomToken(firebaseAuth, authToken)
console.log(response)

I keep getting the mysterious auth/missing-identifier error, about which I couldn't find anything (it is not identical to auth/missing-client-identifier I believe).

Where is the problem? Is my code wrong, or did I set up something incorrectly in the Firebase?

Using firebase 9.8.1

1 Answers

I was also getting this error using firebase v9, but I was only getting this error with Facebook login. I switched to use firebase/compat methods and it worked for me. It's a temporary fix until more light can be shed on this error. I couldn't find the auth/missing-identifier error in any firebase docs so I'm not entirely sure what the underlying issue actually is.

Related