I am signing my firebase custom tokens based on the JSON doc I got from project settngs > Firebase admin SDK.
The same code was working a few days ago and now it's giving me an error:
The custom token format is incorrect. Please check the documentation.
I am using the same code snippet provided by firebase:
var admin = require("firebase-admin");
var serviceAccount = require("path/to/serviceAccountKey.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount)
});
And it worked in past, but now gives me this error! How do I solve this issue?
signInWithCustomToken()
method and once signed in, use thegetIdToken()
method to get an ID token that they can use to authenticate with the back-end. – erwinv