Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

13.0.0 - Firebase Credential -The incoming JSON object does not contain a client_email field #2778

Closed
mustafa-barakat opened this issue Nov 19, 2024 · 7 comments

Comments

@mustafa-barakat
Copy link

mustafa-barakat commented Nov 19, 2024

Describe your environment

  • Operating System version: Docker on Windows
  • Firebase SDK version: 13.0.0
  • Firebase Product: Firebase Admin
  • Node.js version: 18+
  • NPM version: 10.9

Steps to reproduce:

  • Upgrade to firebase admin to 13.0.0
  • When using initializeApp with credential and adding (projectId,clientEmail,privateKey)

This doesn't happen in previous versions

Error
message: 'Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "The incoming JSON object does not contain a client_email field"

Relevant Code:

import { initializeApp } from 'firebase-admin/app';
import { credential } from 'firebase-admin';

initializeApp({
      credential: credential.cert({
        projectId: 'PROJECTID',
        clientEmail:
          'EMAIL,
        privateKey:
          'PRIVKEY',
      }),
    });
@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@ivstiv
Copy link

ivstiv commented Nov 19, 2024

I am running into the exact same issue after the release of v13.

  • Node 20
  • Firebase Admin 13.0.0,
  • Operating System version: node:20-bullseye-slim (debian docker)

This is how I am initialising my app:

import firebaseAdmin from "firebase-admin";

firebaseAdmin.initializeApp({
    credential: firebaseAdmin.credential.cert({
      projectId: "from-env",
      clientEmail: "from-env",
      privateKey: "from-env",
    }),
  },
  "label-here",
);

Probably related?: #2466

@mustafa-barakat
Copy link
Author

I am running into the exact same issue after the release of v13.

  • Node 20
  • Firebase Admin 13.0.0,
  • Operating System version: node:20-bullseye-slim (debian docker)

This is how I am initialising my app:

import firebaseAdmin from "firebase-admin";

firebaseAdmin.initializeApp({
    credential: firebaseAdmin.credential.cert({
      projectId: "from-env",
      clientEmail: "from-env",
      privateKey: "from-env",
    }),
  },
  "label-here",
);

Probably related?: #2466

Yes, and for some reason tests were replaced

@mustafa-barakat
Copy link
Author

Related #2769

@lahirumaramba
Copy link
Member

Thanks folks, this will be fixed in #2779

@lahirumaramba
Copy link
Member

This issue is now fixed in v13.0.1. Thanks for your patience! Please open a new issue if you run into any problems.

@Rene0115
Copy link

thanks for this

This issue is now fixed in v13.0.1. Thanks for your patience! Please open a new issue if you run into any problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants