- 
                Notifications
    
You must be signed in to change notification settings  - Fork 407
 
Description
[REQUIRED] Step 2: Describe your environment
- Operating System version: Mac OS 13.0.1
 - Firebase SDK version: 11.3.0
 - Firebase Product: auth
 - Node.js version: v18.12.0
 - NPM version: 8.19.2
 
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
gcloud config set project $project_id
gcloud auth application-default login
With this, I'd assume that the ADC has been generated and the auth module should be able to make authenticated calls to firebase servers but I end up with this response: Failed to determine project ID for Auth. Initialize the SDK with service account credentials or set project ID as an app option. Alternatively set the GOOGLE_CLOUD_PROJECT environment variable.
Ok. Fine. I follow the instructions laid out here. I end up with the same response. I have also tried passing the project-id in the init function but still. Any ideas about what I might be doing incorrectly or is this a bug?
Relevant Code:
// Initialize Firebase Admin
import * as admin from "firebase-admin";
let app;
const appExists = !(admin.apps.length <= 0);
if (appExists) {
  app = admin.apps[0] as admin.app.App;
} else {
  app = admin.initializeApp({
      credential: admin.credential.applicationDefault(),
    } );
}
const auth = app.auth();
export { auth, app };import { auth } from "./index";
const manager = auth.tenantManager();
const createTenant = async (displayName: string) => {
    const tenant = await manager.createTenant({
      displayName: displayName,
      emailSignInConfig: { enabled: true, passwordRequired: true },
    });
    return tenant.toJSON();
};
export { createTenant };Calling createTenant returns this response Failed to determine project ID for Auth. Initialize the SDK with service account credentials or set project ID as an app option. Alternatively set the GOOGLE_CLOUD_PROJECT environment variable.