See the documentation for more information about authenticating for Google Cloud APIs.
-
Install dependencies from
package.json
$ npm install
-
Set the environment variable
GOOGLE_CLOUD_PROJECT
to the project ID, set the environment variableGOOGLE_APPLICATION_CREDENTIALS
to the credential you're using. To run the sample, you need to provide the impersonated service account name and the scope. See the sample for information on how to set up the service accounts in your Google Cloud project. -
To run the individual accessTokenFromImpersonatedCredentials.js test, you can do:
$ npm run test:accessTokenFromImpersonatedCredentials
See the documentation for more information about authenticating for Google Cloud APIs.
-
Install dependencies from
package.json
$ npm install
-
Set the environment variable
GOOGLE_CLOUD_PROJECT
to the project ID, set the environment variableGOOGLE_APPLICATION_CREDENTIALS
to the credential you're using, and set the environment variableBUCKET_NAME
to a bucket you created in the project. -
To run the individual auth.js test, you can do:
$ npm run test:auth
This section contains samples for Downscoping with Credential Access Boundaries.
-
Your environment must be setup with authentication information. If you're running on Cloud Shell or Compute Engine, this is already setup. You can also use
gcloud auth application-default login
. -
Install dependencies from
package.json
$ npm install
-
Set the environment variable
GOOGLE_CLOUD_PROJECT
to the project ID. -
To run the individual downscoping.js test, you can do:
$ npm run test:downscoping
For more information on downscoped credentials you can visit: