Skip to content
Back to skills

Google Cloud Recipe Auth

ASecurity

Use when authenticating and authorizing to Google Cloud services and APIs.

  • 2 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 10, 2026
ai-agentspythongobashgcpapisecurity

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add LoopyLuci/Skills --skill google-cloud-recipe-auth --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Google Cloud Recipe Auth?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Google Cloud Recipe Auth
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/loopyluci-google-cloud-recipe-auth/badge)](https://www.skillsdirectory.com/skills/loopyluci-google-cloud-recipe-auth)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: google-cloud-recipe-auth
description: Use when authenticating and authorizing to Google Cloud services and APIs.
tags: [google-cloud, authentication, iam, service-accounts, security, adc]
related_skills: [gke-productionize, gemini-api, firebase-basics]
---

# Authenticating to Google Cloud

Authentication is the process of proving who you are. Google Cloud supports multiple identity types and authentication methods for different scenarios.

## Clarifying Questions

Before providing a solution, determine:
1. **Who/what is authenticating?** (Human developer, local script, or production app?)
2. **Where is the code running?** (Local laptop, Compute Engine, GKE, Cloud Run, or external cloud?)
3. **What is the target?** (Google Cloud API or custom application?)
4. **Are you using a client library?** (Libraries handle ADC automatically)

## Human Authentication

```bash
# CLI authentication
gcloud auth login

# Local development (Application Default Credentials)
gcloud auth application-default login
```

## Service-to-Service Authentication

```bash
# Attach a custom service account (GKE example)
# 1. Create service account
gcloud iam service-accounts create my-app-sa --project=PROJECT_ID

# 2. Grant permissions
gcloud projects add-iam-policy-binding PROJECT_ID \
  --member="serviceAccount:my-app-sa@PROJECT_ID.iam.gserviceaccount.com" \
  --role="roles/storage.objectViewer"

# 3. Use Workload Identity on GKE  
kubectl annotate serviceaccount APP_SA \
  iam.gke.io/gcp-service-account=my-app-sa@PROJECT_ID.iam.gserviceaccount.com
```

## Code Example: Using ADC (Python)

```python
from google.cloud import storage

# ADC automatically finds credentials
client = storage.Client()

# List buckets
buckets = list(client.list_buckets())
```

## Common Pitfalls

- **Service account keys**: Avoid downloading JSON keys — use impersonation or Workload Identity instead
- **Default service account**: Create custom service accounts rather than using the Compute Engine default
- **Access scopes**: Legacy VMs still use access scopes — check these if attached SA fails
- **API keys**: Restrict to specific APIs and projects; store in Secret Manager

## Verification Checklist

- [ ] Identity type determined (human vs service)
- [ ] auth method matches execution environment
- [ ] Least-privilege IAM roles applied
- [ ] No service account keys committed to code
- [ ] ADC configured for local development

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.