google-cloud-recipe-auth

Guides authentication and authorization setup for Google Cloud services and APIs.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/danilonovaisv/DAN-IMAGES-PROMPTS-2 --skill google-cloud-recipe-auth-danilonovaisv
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: google-cloud-recipe-auth
Source: https://github.com/danilonovaisv/DAN-IMAGES-PROMPTS-2/tree/main/agent/skills/google-cloud-recipe-auth
Command: npx skills add https://github.com/danilonovaisv/DAN-IMAGES-PROMPTS-2 --skill google-cloud-recipe-auth-danilonovaisv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Choosing the correct authentication method for Google Cloud is confusing: developers often misuse service account keys, confuse gcloud CLI auth with Application Default Credentials, or pick the wrong identity approach for humans, services, and external workloads. ## Core Features & Use Cases - Decision Guidance: Clarifying questions help identify who is authenticating, where code runs, and what the target API is before recommending a solution. - Human Authentication: Covers gcloud CLI login, Application Default Credentials for local development, service account impersonation, Workforce Identity Federation, IAP, and Identity Platform. - Service-to-Service Authentication: Explains attaching service accounts to Compute Engine and Cloud Run, Workload Identity Federation for GKE and external clouds, OIDC ID tokens, and API key restrictions. - Use Case: A developer running a Python script locally that calls Cloud Storage gets directed to gcloud auth application-default login with ADC instead of downloading a risky service account key. ## Quick Start Ask how to authenticate my application to Google Cloud based on where it runs and which API it calls.

Frequently Asked Questions about google-cloud-recipe-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I authenticate to Google Cloud from local Python code?▼

Run gcloud auth application-default login to create local Application Default Credentials. Google Cloud client libraries like the Python storage client automatically find these credentials, so your code acts as your user identity without downloading service account keys.

What is the difference between gcloud auth login and application-default login?▼

gcloud auth login authenticates the gcloud CLI itself for management commands. gcloud auth application-default login creates a local credential file that client libraries use via Application Default Credentials when your code calls Google Cloud APIs.

Should I use service account keys for production workloads?▼

No. Attach a custom least-privilege service account directly to the resource, such as a Compute Engine VM or Cloud Run service, so the environment provides short-lived tokens via the metadata server. For external clouds, use Workload Identity Federation instead.

How do I authenticate workloads running on AWS or Azure to Google Cloud?▼

Use Workload Identity Federation to exchange an external token, such as an AWS IAM role credential, for a short-lived Google Cloud access token. This avoids storing static service account keys outside Google Cloud.

Why does my attached service account fail API calls despite correct IAM roles?▼

Legacy Compute Engine VMs and GKE node pools also enforce OAuth access scopes alongside IAM. If the VM's scope is restricted, API calls fail even with correct IAM permissions, so check the access scopes first.

How do services call a private Cloud Run application securely?▼

The calling service generates a Google-signed OpenID Connect ID token and sends it in the Authorization Bearer header. The private Cloud Run service verifies this OIDC token before allowing the request.