I can't seem to authenticate with the Firebase Admin SDK on a GCE VM. With
admin.initializeApp({
credential: admin.credential.applicationDefault(),
databaseURL: `https://${PROJECT_ID}-default-rtdb.firebaseio.com`,
});
my app indicates
Error: 7 PERMISSION_DENIED: Request had insufficient authentication scopes.
From what I can tell, this is because the scopes are missing on the Application Default Credentials? Isn't this supposed to be configured automatically?
I've verified that if I take the compute service account, generate a json key, and then pass it to the admin sdk manually everything works, so I'm not clear why it doesn't correctly fetch the credentials.