I have read many articles regarding using Firebase Custom Tokens. To summarize, there are three steps:
- Create a custom token using
firebase-admin.auth().createCustomToken(/* user ID */) - Get an ID token by exchanging the custom token.
- Post documents to Firestore
I can obtain the ID token from both of the below APIs.
https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyCustomToken?key=API_KEY
https://identitytoolkit.googleapis.com/v1/accounts:signInWithCustomToken?key=API_KEY
Of these two Google APIs, which should I be using for a new project?
Some information that I'd also like to know:
- Are these APIs actually the same?
- What is the difference between the two aside from the names
verifyCustomTokenandaccounts:signInWithCustomToken? - Should I use the v3 API because it's not v1? Some tutorials still refer to the v1 API.