Keys / Google Cloud
GOOGLE_APPLICATION_CREDENTIALS
The path to a JSON credential file that Google Cloud libraries sign in with. It holds a file path, not a key; the file can be a service account key.
- Expires
- keys never, unless your organization sets a limit
- API
- create, list, disable and delete keys, with the IAM API
Get it
Create one on console.cloud.google.com/iam-admin/serviceaccounts. The steps aren't recorded yet.
Set it
GOOGLE_APPLICATION_CREDENTIALS=...
Application Default Credentials in Google's auth libraries for Python, Node.js, Go and Java read it when you don't pass credentials. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- Google recommends avoiding key files: on Google Cloud, attach a service account to the resource instead; elsewhere, point
GOOGLE_APPLICATION_CREDENTIALSat a Workload Identity Federation configuration file. - If you still need a key, open the service account on the Service accounts page and add a new JSON key. A service account can have up to 10 keys. Organizations created since May 3, 2024 block key creation by default.
- Put the new file on every machine that uses the old one and point
GOOGLE_APPLICATION_CREDENTIALSat it. - Disable the old key and check that your apps still work. Then delete it; a deleted key can't be restored.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.
Sources, checked 2026-11-16
- Google Cloud: How Application Default Credentials works
- Google Cloud: Set up ADC for on-premises or another cloud provider
- IAM: Create and delete service account keys
- IAM: Service account key rotation
- IAM: Best practices for managing service account keys
- IAM API: projects.serviceAccounts.keys
- google-auth-library-python: reads GOOGLE_APPLICATION_CREDENTIALS
- google-auth-library-nodejs: reads GOOGLE_APPLICATION_CREDENTIALS
- golang/oauth2: reads GOOGLE_APPLICATION_CREDENTIALS
- google-auth-library-java: reads GOOGLE_APPLICATION_CREDENTIALS