applicationDefault static method

Credential? applicationDefault()

Returns a Credential created from the Google Application Default Credentials (ADC) that grants admin access to Firebase services.

This credential can be used in the call to initializeApp.

This will look for credentials in the following locations:

  • the service-account.json file in the package main directory
  • the service account file path specified in the env variable GOOGLE_APPLICATION_CREDENTIALS
  • the configuration file stored at firebaseAdminCredentialPath containing credentials obtained with Credentials.login
  • gcloud's application default credentials
  • credentials from the firebase tools

Implementation

static Credential? applicationDefault() =>
    _globalAppDefaultCred ??= _getApplicationDefault();