0

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.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
kevmo314
  • 4,223
  • 4
  • 32
  • 43

1 Answers1

2

Turns out there's a checkbox that needs to be checked when creating the instance

enter image description here

kevmo314
  • 4,223
  • 4
  • 32
  • 43