You do not provide code snippets, so I will reflect here.
I assume that you are using node.js to create a custom token. Try this in a node script:
var firebase = require("firebase");
var adminConfig = {
serviceAccount: "serviceAccountCredentials.json"
};
var adminApp = firebase.initializeApp(adminConfig, 'admin');
var token = adminApp.auth().createCustomToken('12345678', {
customField: 'customValue'
});
Then, on the client, try signing the InWithCustomToken (token). Make sure that the client uses the same api key that belongs to the same project in which the service account was created.
source
share