Google-api-nodejs-client: Unable to use Application Default Credentials (locally) w/ Runtime Configuration v1beta1

Created on 23 Aug 2017  路  2Comments  路  Source: googleapis/google-api-nodejs-client

I'm unable to set the Project ID w/ Runtime Configuration v1beta1.

I'd prefer to use the new Cloud Client Library but Runtime Configuration API is not available.

'Google Cloud Runtime Configuration API has not been used in project usable-auth-library before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/runtimeconfig.googleapis.com/overview?project=usable-auth-library then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.'

It's unclear why the library is defaulting to 'usable-auth-library'.

The API is enabled in my project.

I'm gcloud auth application-default logged in.

It's unclear to me which signature I need for getApplicationDefault but I've tried with/out projectId:
google.auth.getApplicationDefault(function (err, authClient[, projectId]) {...}

With the projectId parameter, its value is undefined.

Without the parameter, the value of authClient.projectId is undefined

I appear unable to explicitly set project on the get method's options (Unknown name).

I appear unable to explicitly set GCLOUD_PROJECT

        runtimeconfig.projects.configs.variables.get({
            auth: authClient,
            name: FQN
        }, function(err, result){
            console.log(err, result);
        });

I'm using:
"googleapis": "^20.1.0"

I'm stumped. Please help. Thanks!

Most helpful comment

Aha! Of course! That worked!

I've encountered this problem before where services aren't enabled in the project associated with Application Default Credentials. I'm a Googler too. I'll ping the project owners.

Thank you @jmdobry

All 2 comments

Instead of relying on gcloud auth application-default login (which uses a shared gcloud project for billing), try this:

  1. Create and download a Service Account .json key file
  2. Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to /path/to/your/keyfile.json.

Let me know how that goes.

Aha! Of course! That worked!

I've encountered this problem before where services aren't enabled in the project associated with Application Default Credentials. I'm a Googler too. I'll ping the project owners.

Thank you @jmdobry

Was this page helpful?
0 / 5 - 0 ratings

Related issues

raapperez picture raapperez  路  3Comments

ovaris picture ovaris  路  3Comments

eduDorus picture eduDorus  路  3Comments

oliverjessner picture oliverjessner  路  3Comments

joseparoli picture joseparoli  路  3Comments