[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AFSHJNJ1694Z5NSZF8SNS3":3,"skill-same:01M6AFSHJNJ1694Z5NSZF8SNS3":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":50,"linkOnly":51,"markdownContent":52,"markdownBody":53,"frontMatter":54,"refName":57,"commitSha":58,"skillDirectory":59,"forksCount":60,"repositoryHtmlUrl":61,"repositoryHomepageUrl":62,"ownerHtmlUrl":63,"ownerBlogUrl":64,"ownerDescription":65,"updatedAt":66,"install":67,"resources":80},"01M6AFSHJNJ1694Z5NSZF8SNS3","google-cloud-auth","Google Cloud认证与授权","Provides expert guidance on authenticating and authorizing to Google Cloud services and APIs, covering human users, service identities, Application Default Credentials (ADC), and best practices for secure access.","针对 Google Cloud 服务和 API 的认证与授权提供专业指导，涵盖人工用户、服务身份、应用默认凭证（ADC）以及安全访问的最佳实践。","davila7\u002Fclaude-code-templates","davila7","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6216945?v=4","01M6ADEWWFPS191NFM0Y1EX1JH","Daniel Avila","01M6ADJHGM78PHQRD3XZTFDVKK",33602,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fgoogle-cloud-auth\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BT9F3Z67AB1M6CHA8X75WW","云架构师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTFDX7M21YT75733H52N36","身份与访问管理","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"google cloud","google cloud auth","cloud","auth","google","secure","best practices","apache","services","credentials","access","guidance","default","expert","application","human","service","users","for","2026-11-10 10:12:30",false,"---\nname: google-cloud-auth\ndescription: Provides expert guidance on authenticating and authorizing to Google Cloud services and APIs, covering human users, service identities, Application Default Credentials (ADC), and best practices for secure access.\nmetadata:\n  source: google\u002Fskills (Apache 2.0)\n---\n\n# Authenticating to Google Cloud\n\n[Authentication](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication) is the\nprocess of proving **who you are**. In Google Cloud, you represent a\n**Principal** (an identity like a user or a service). This is the first step\nbefore [Authorization](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Foverview)\n(determining **what you can do**).\n\n## Authentication\n\n### Clarifying Questions for the Agent\n\nBefore providing a specific solution, clarify the following with the user:\n\n1.  **Who or what is authenticating?** (A human developer, a local script, or an\n    application running in production?)\n2.  **Where is the code running?** (Local laptop, [Compute\n    Engine](https:\u002F\u002Fdocs.cloud.google.com\u002Fcompute\u002Fdocs),\n    [GKE](https:\u002F\u002Fdocs.cloud.google.com\u002Fkubernetes-engine\u002Fdocs), [Cloud\n    Run](https:\u002F\u002Fdocs.cloud.google.com\u002Frun\u002Fdocs), or another cloud like\n    AWS\u002FAzure?)\n3.  **What is the target?** (A Google Cloud API like Storage\u002FBigQuery, or a\n    custom application you built?)\n4.  **Are you using a high-level client library?** (e.g., Python, Go, Node.js\n    libraries usually handle ADC automatically.)\n\n---\n\n## Human Authentication\n\nFor users to access Google Cloud, they need an identity that Google Cloud can\nrecognize.\n\n### Types of User Identities\n\nGoogle Cloud supports several ways to configure identities for your internal\nworkforce (developers, administrators, employees):\n\n*   **[Google-Managed\n    Accounts](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fuser-identities#google-accounts)**:\n    You can use Cloud Identity or Google Workspace to create managed user\n    accounts. These are called managed accounts because your organization\n    controls their lifecycle and configuration.\n*   **[Federation using Cloud Identity or Google\n    Workspace](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fuser-identities#synced-federation)**:\n    You can federate identities to allow users to use their existing identity\n    and credentials to sign in to Google services. Users authenticate against an\n    external identity provider (IdP), but you must keep accounts synchronized\n    into Google Cloud using tools like Google Cloud Directory Sync (GCDS) or an\n    external authoritative source like Active Directory or Microsoft Entra ID.\n*   **[Workforce Identity\n    Federation](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fuser-identities#workforce)**:\n    This lets you use an external IdP to authenticate and authorize a workforce\n    using IAM directly. Unlike standard federation, you do not need to\n    synchronize user identities from your existing IdP to Google Cloud\n    identities. It supports syncless, attribute-based single sign-on.\n\n### Methods of Access for Developers and Administrators\n\nUsed for interacting with Google Cloud resources and APIs during development and\nmanagement.\n\n*   **[Google Cloud Console](https:\u002F\u002Fconsole.cloud.google.com\u002F)**: The primary\n    web interface. You authenticate using your Google Account (Gmail or [Google\n    Workspace](https:\u002F\u002Fworkspace.google.com\u002F)).\n*   **[gcloud CLI](https:\u002F\u002Fdocs.cloud.google.com\u002Fsdk\u002Fdocs\u002Finstall-sdk) (`gcloud\n    auth login`)**: Used to authenticate the CLI itself so you can run\n    management commands (e.g., `gcloud compute instances list`). It uses a\n    **Credential** (like an OAuth 2.0 refresh token) stored locally.\n*   **Local Development with [App Default Credentials\n    (ADC)](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fapplication-default-credentials)\n    (`gcloud auth application-default login`)**: This is different from CLI\n    auth. It creates a local JSON file that Google Cloud **Client Libraries**\n    (Python, Java, etc.) use to act as \"you\" when you run code on your laptop.\n*   **[Service Account\n    Impersonation](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fuse-service-account-impersonation)**:\n    For security reasons, developers should avoid downloading Service Account\n    keys entirely. Instead, they should authenticate as humans (`gcloud auth\n    login`) and use Service Account Impersonation to run CLI commands or\n    generate short-lived credentials. This is a critical best practice for local\n    development and troubleshooting.\n\n### For End-Users and Customers\n\nUsed when a human (who is not a developer) needs to access a web application\nyou've deployed on Google Cloud. Note: These are distinct from workforce\nidentities.\n\n*   **[Identity-Aware Proxy (IAP)](https:\u002F\u002Fdocs.cloud.google.com\u002Fiap\u002Fdocs)**:\n    Acts as a central authorization layer for web applications. It intercepts\n    web requests and verifies the user's identity (via Google Workspace, Cloud\n    Identity, or external providers) before letting them reach the application.\n    It's often used to protect internal apps without a VPN, or secure customer\n    portals.\n*   **[Identity\n    Platform](https:\u002F\u002Fdocs.cloud.google.com\u002Fidentity-platform\u002Fdocs)**: A\n    Customer Identity and Access Management (CIAM) solution for adding consumer\n    sign-in (email\u002Fpassword, phone, social) directly into the code of your\n    custom-built applications.\n\n---\n\n## Service-to-Service Authentication\n\nWhen code runs in production, it should use a **Service Account** rather than a\nhuman user account.\n\n### Service Accounts and Service Agents\n\n*   **[Service\n    Account](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fservice-account-overview)**:\n    A special identity intended for non-human users. It's like a \"robot\n    identity\" with its own email address.\n*   **[Service Agent](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fservice-agents)**:\n    A service account managed by Google that allows a service (like Pub\u002FSub) to\n    access your resources on your behalf.\n\n### Best Practice: Attaching Service Accounts\n\nInstead of using **Service Account Keys** (dangerous JSON files), you should\n**attach** a custom service account to the Google Cloud resource. The resource's\nenvironment then provides a **Token** (a short-lived digital object) via a local\nmetadata server.\n\n*   **[Compute\n    Engine](https:\u002F\u002Fdocs.cloud.google.com\u002Fcompute\u002Fdocs\u002Faccess\u002Fcreate-enable-service-accounts-for-instances)**:\n    Assign a service account during VM creation.\n*   **[Cloud\n    Run](https:\u002F\u002Fdocs.cloud.google.com\u002Frun\u002Fdocs\u002Fsecuring\u002Fservice-identity)**:\n    Assign a service account in the service configuration.\n\n### Special Cases & Advanced Topics\n\n#### Kubernetes Engine (GKE)\n\nUse **[Workload Identity Federation for\nGKE](https:\u002F\u002Fdocs.cloud.google.com\u002Fkubernetes-engine\u002Fdocs\u002Fhow-to\u002Fworkload-identity)**\nto map Kubernetes identities to IAM principal identifiers. This grants specific\nKubernetes workloads access to specific Google Cloud APIs. [Learn more\nhere.](https:\u002F\u002Fdocs.cloud.google.com\u002Fkubernetes-engine\u002Fdocs\u002Fhow-to\u002Fworkload-identity#configure-authz-principals)\n\n#### External Workloads ([Workload Identity Federation](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fworkload-identity-federation))\n\nFor code running **outside** Google Cloud (e.g., AWS, Azure, or on-prem), do not\nuse keys. Instead, use Workload Identity Federation to exchange an external\ntoken (like an AWS IAM role) for a short-lived Google Cloud access token.\n\n#### [API Keys](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fapi-keys)\n\nAPI keys are encrypted strings used for public data (e.g., Google Maps) or\nsimplified access like **[Vertex AI Express\nMode](https:\u002F\u002Fdocs.cloud.google.com\u002Fvertex-ai\u002Fgenerative-ai\u002Fdocs\u002Fstart\u002Fexpress-mode\u002Foverview)**,\nwhich allows fast testing of Gemini models without complex setup. Both humans\nand services (e.g., Cloud Run-based AI agent) can use API keys, for the services\nthat support it.\n\nNote: API keys should be\n[restricted](https:\u002F\u002Fdocs.cloud.google.com\u002Fapi-keys\u002Fdocs\u002Fadd-restrictions-api-keys)\nto specific APIs and projects to minimize security risks. Store API keys in a\nsecrets manager like [Secret\nManager](https:\u002F\u002Fdocs.cloud.google.com\u002Fsecret-manager\u002Fdocs) to prevent\naccidental exposure.\n\n#### OAuth 2.0 Access Scopes\n\nWhile IAM is the modern way to handle authorization, legacy Compute Engine VMs\nand GKE node pools still rely on **Access Scopes** alongside IAM. If a VM's\nscope is restricted, the attached service account will fail to make API calls\neven if it has the correct IAM permissions. Check this first if attached service\naccounts are failing unexpectedly.\n\n#### Short-Lived Credentials\n\nThe underlying mechanism for impersonation and secure service-to-service\ncommunication is the **IAM Service Account Credentials API**. This API generates\nshort-lived access tokens, OpenID Connect (OIDC) ID tokens, or self-signed JSON\nWeb Tokens (JWTs) dynamically, removing the need for static credentials.\n\n---\n\n## Authorization\n\nAfter Authentication, Google Cloud uses **[Identity and Access Management\n(IAM)](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Foverview)** to determine what the\nauthenticated principal can do.\n\n*   **Allow Policy**: A record that binds a **Principal** to a **Role** on a\n    **Resource**.\n*   **[Predefined\n    Roles](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Funderstanding-roles)**:\n    Prebuilt roles like `roles\u002Fstorage.objectViewer` or\n    `roles\u002Fbigquery.dataEditor`. **Always try to use these first.**\n*   **[Custom\n    Roles](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fcreating-custom-roles)**:\n    User-defined collections of specific permissions if predefined roles are too\n    broad.\n\n---\n\n## Examples\n\n### Human-to-Service (Local Python Development)\n\n1.  **Authn**: Run `gcloud auth application-default login` to create local\n    credentials (ADC).\n2.  **Authz**: Grant your email the `roles\u002Fstorage.objectViewer` role on a\n    bucket.\n3.  **Code**: Use the Python `storage.Client()`. It automatically finds your\n    local credentials via ADC. *Note: ADC searches in a specific order—first\n    checking the `GOOGLE_APPLICATION_CREDENTIALS` environment variable, then the\n    local gcloud JSON file, and finally the attached service account metadata\n    server.*\n\n### Service-to-Service (Cloud Run to Cloud SQL)\n\n1.  **Authn**: Attach a custom Service Account to your Cloud Run service.\n2.  **Authz**: Grant that Service Account the `roles\u002Fcloudsql.client` role on\n    the project.\n3.  **Code**: The Cloud Run environment provides the token automatically to the\n    connection driver.\n\n### Calling a Custom Application ([OIDC](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fget-id-token))\n\nWhen calling a private Cloud Run service from another service, the caller\ngenerates a Google-signed **OpenID Connect (OIDC) ID Token** and passes it in\nthe `Authorization: Bearer \u003CTOKEN>` header.\n\n---\n\n## Validation Checklist\n\n-   [ ] Is the user running code locally? Suggest `gcloud auth\n    application-default login` or **Service Account Impersonation**.\n-   [ ] Is the user attempting to use Service Account keys locally? Strongly\n    discourage this and recommend impersonation.\n-   [ ] Is the user running in production? Recommend attaching a custom,\n    least-privilege service account, NOT using keys.\n-   [ ] Is the user relying on the Compute Engine Default Service Account?\n    Recommend creating a custom service account instead.\n-   [ ] Is the user running on another cloud? Recommend Workload Identity\n    Federation.\n-   [ ] Is the user calling a custom app? Recommend OIDC ID Tokens.\n-   [ ] Has the user restricted their API Keys? Check for appropriate [API Key\n    Restrictions](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fapi-keys#adding-application-restrictions).\n\n## References\n\n-   [Authentication Overview](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication)\n-   [User Identities](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fuser-identities)\n-   [Application Default Credentials](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fprovide-credentials-adc)\n-   [Service Account Best Practices](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fbest-practices-service-accounts)\n","# Authenticating to Google Cloud\n\n[Authentication](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication) is the\nprocess of proving **who you are**. In Google Cloud, you represent a\n**Principal** (an identity like a user or a service). This is the first step\nbefore [Authorization](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Foverview)\n(determining **what you can do**).\n\n## Authentication\n\n### Clarifying Questions for the Agent\n\nBefore providing a specific solution, clarify the following with the user:\n\n1.  **Who or what is authenticating?** (A human developer, a local script, or an\n    application running in production?)\n2.  **Where is the code running?** (Local laptop, [Compute\n    Engine](https:\u002F\u002Fdocs.cloud.google.com\u002Fcompute\u002Fdocs),\n    [GKE](https:\u002F\u002Fdocs.cloud.google.com\u002Fkubernetes-engine\u002Fdocs), [Cloud\n    Run](https:\u002F\u002Fdocs.cloud.google.com\u002Frun\u002Fdocs), or another cloud like\n    AWS\u002FAzure?)\n3.  **What is the target?** (A Google Cloud API like Storage\u002FBigQuery, or a\n    custom application you built?)\n4.  **Are you using a high-level client library?** (e.g., Python, Go, Node.js\n    libraries usually handle ADC automatically.)\n\n---\n\n## Human Authentication\n\nFor users to access Google Cloud, they need an identity that Google Cloud can\nrecognize.\n\n### Types of User Identities\n\nGoogle Cloud supports several ways to configure identities for your internal\nworkforce (developers, administrators, employees):\n\n*   **[Google-Managed\n    Accounts](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fuser-identities#google-accounts)**:\n    You can use Cloud Identity or Google Workspace to create managed user\n    accounts. These are called managed accounts because your organization\n    controls their lifecycle and configuration.\n*   **[Federation using Cloud Identity or Google\n    Workspace](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fuser-identities#synced-federation)**:\n    You can federate identities to allow users to use their existing identity\n    and credentials to sign in to Google services. Users authenticate against an\n    external identity provider (IdP), but you must keep accounts synchronized\n    into Google Cloud using tools like Google Cloud Directory Sync (GCDS) or an\n    external authoritative source like Active Directory or Microsoft Entra ID.\n*   **[Workforce Identity\n    Federation](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fuser-identities#workforce)**:\n    This lets you use an external IdP to authenticate and authorize a workforce\n    using IAM directly. Unlike standard federation, you do not need to\n    synchronize user identities from your existing IdP to Google Cloud\n    identities. It supports syncless, attribute-based single sign-on.\n\n### Methods of Access for Developers and Administrators\n\nUsed for interacting with Google Cloud resources and APIs during development and\nmanagement.\n\n*   **[Google Cloud Console](https:\u002F\u002Fconsole.cloud.google.com\u002F)**: The primary\n    web interface. You authenticate using your Google Account (Gmail or [Google\n    Workspace](https:\u002F\u002Fworkspace.google.com\u002F)).\n*   **[gcloud CLI](https:\u002F\u002Fdocs.cloud.google.com\u002Fsdk\u002Fdocs\u002Finstall-sdk) (`gcloud\n    auth login`)**: Used to authenticate the CLI itself so you can run\n    management commands (e.g., `gcloud compute instances list`). It uses a\n    **Credential** (like an OAuth 2.0 refresh token) stored locally.\n*   **Local Development with [App Default Credentials\n    (ADC)](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fapplication-default-credentials)\n    (`gcloud auth application-default login`)**: This is different from CLI\n    auth. It creates a local JSON file that Google Cloud **Client Libraries**\n    (Python, Java, etc.) use to act as \"you\" when you run code on your laptop.\n*   **[Service Account\n    Impersonation](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fuse-service-account-impersonation)**:\n    For security reasons, developers should avoid downloading Service Account\n    keys entirely. Instead, they should authenticate as humans (`gcloud auth\n    login`) and use Service Account Impersonation to run CLI commands or\n    generate short-lived credentials. This is a critical best practice for local\n    development and troubleshooting.\n\n### For End-Users and Customers\n\nUsed when a human (who is not a developer) needs to access a web application\nyou've deployed on Google Cloud. Note: These are distinct from workforce\nidentities.\n\n*   **[Identity-Aware Proxy (IAP)](https:\u002F\u002Fdocs.cloud.google.com\u002Fiap\u002Fdocs)**:\n    Acts as a central authorization layer for web applications. It intercepts\n    web requests and verifies the user's identity (via Google Workspace, Cloud\n    Identity, or external providers) before letting them reach the application.\n    It's often used to protect internal apps without a VPN, or secure customer\n    portals.\n*   **[Identity\n    Platform](https:\u002F\u002Fdocs.cloud.google.com\u002Fidentity-platform\u002Fdocs)**: A\n    Customer Identity and Access Management (CIAM) solution for adding consumer\n    sign-in (email\u002Fpassword, phone, social) directly into the code of your\n    custom-built applications.\n\n---\n\n## Service-to-Service Authentication\n\nWhen code runs in production, it should use a **Service Account** rather than a\nhuman user account.\n\n### Service Accounts and Service Agents\n\n*   **[Service\n    Account](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fservice-account-overview)**:\n    A special identity intended for non-human users. It's like a \"robot\n    identity\" with its own email address.\n*   **[Service Agent](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fservice-agents)**:\n    A service account managed by Google that allows a service (like Pub\u002FSub) to\n    access your resources on your behalf.\n\n### Best Practice: Attaching Service Accounts\n\nInstead of using **Service Account Keys** (dangerous JSON files), you should\n**attach** a custom service account to the Google Cloud resource. The resource's\nenvironment then provides a **Token** (a short-lived digital object) via a local\nmetadata server.\n\n*   **[Compute\n    Engine](https:\u002F\u002Fdocs.cloud.google.com\u002Fcompute\u002Fdocs\u002Faccess\u002Fcreate-enable-service-accounts-for-instances)**:\n    Assign a service account during VM creation.\n*   **[Cloud\n    Run](https:\u002F\u002Fdocs.cloud.google.com\u002Frun\u002Fdocs\u002Fsecuring\u002Fservice-identity)**:\n    Assign a service account in the service configuration.\n\n### Special Cases & Advanced Topics\n\n#### Kubernetes Engine (GKE)\n\nUse **[Workload Identity Federation for\nGKE](https:\u002F\u002Fdocs.cloud.google.com\u002Fkubernetes-engine\u002Fdocs\u002Fhow-to\u002Fworkload-identity)**\nto map Kubernetes identities to IAM principal identifiers. This grants specific\nKubernetes workloads access to specific Google Cloud APIs. [Learn more\nhere.](https:\u002F\u002Fdocs.cloud.google.com\u002Fkubernetes-engine\u002Fdocs\u002Fhow-to\u002Fworkload-identity#configure-authz-principals)\n\n#### External Workloads ([Workload Identity Federation](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fworkload-identity-federation))\n\nFor code running **outside** Google Cloud (e.g., AWS, Azure, or on-prem), do not\nuse keys. Instead, use Workload Identity Federation to exchange an external\ntoken (like an AWS IAM role) for a short-lived Google Cloud access token.\n\n#### [API Keys](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fapi-keys)\n\nAPI keys are encrypted strings used for public data (e.g., Google Maps) or\nsimplified access like **[Vertex AI Express\nMode](https:\u002F\u002Fdocs.cloud.google.com\u002Fvertex-ai\u002Fgenerative-ai\u002Fdocs\u002Fstart\u002Fexpress-mode\u002Foverview)**,\nwhich allows fast testing of Gemini models without complex setup. Both humans\nand services (e.g., Cloud Run-based AI agent) can use API keys, for the services\nthat support it.\n\nNote: API keys should be\n[restricted](https:\u002F\u002Fdocs.cloud.google.com\u002Fapi-keys\u002Fdocs\u002Fadd-restrictions-api-keys)\nto specific APIs and projects to minimize security risks. Store API keys in a\nsecrets manager like [Secret\nManager](https:\u002F\u002Fdocs.cloud.google.com\u002Fsecret-manager\u002Fdocs) to prevent\naccidental exposure.\n\n#### OAuth 2.0 Access Scopes\n\nWhile IAM is the modern way to handle authorization, legacy Compute Engine VMs\nand GKE node pools still rely on **Access Scopes** alongside IAM. If a VM's\nscope is restricted, the attached service account will fail to make API calls\neven if it has the correct IAM permissions. Check this first if attached service\naccounts are failing unexpectedly.\n\n#### Short-Lived Credentials\n\nThe underlying mechanism for impersonation and secure service-to-service\ncommunication is the **IAM Service Account Credentials API**. This API generates\nshort-lived access tokens, OpenID Connect (OIDC) ID tokens, or self-signed JSON\nWeb Tokens (JWTs) dynamically, removing the need for static credentials.\n\n---\n\n## Authorization\n\nAfter Authentication, Google Cloud uses **[Identity and Access Management\n(IAM)](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Foverview)** to determine what the\nauthenticated principal can do.\n\n*   **Allow Policy**: A record that binds a **Principal** to a **Role** on a\n    **Resource**.\n*   **[Predefined\n    Roles](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Funderstanding-roles)**:\n    Prebuilt roles like `roles\u002Fstorage.objectViewer` or\n    `roles\u002Fbigquery.dataEditor`. **Always try to use these first.**\n*   **[Custom\n    Roles](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fcreating-custom-roles)**:\n    User-defined collections of specific permissions if predefined roles are too\n    broad.\n\n---\n\n## Examples\n\n### Human-to-Service (Local Python Development)\n\n1.  **Authn**: Run `gcloud auth application-default login` to create local\n    credentials (ADC).\n2.  **Authz**: Grant your email the `roles\u002Fstorage.objectViewer` role on a\n    bucket.\n3.  **Code**: Use the Python `storage.Client()`. It automatically finds your\n    local credentials via ADC. *Note: ADC searches in a specific order—first\n    checking the `GOOGLE_APPLICATION_CREDENTIALS` environment variable, then the\n    local gcloud JSON file, and finally the attached service account metadata\n    server.*\n\n### Service-to-Service (Cloud Run to Cloud SQL)\n\n1.  **Authn**: Attach a custom Service Account to your Cloud Run service.\n2.  **Authz**: Grant that Service Account the `roles\u002Fcloudsql.client` role on\n    the project.\n3.  **Code**: The Cloud Run environment provides the token automatically to the\n    connection driver.\n\n### Calling a Custom Application ([OIDC](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fget-id-token))\n\nWhen calling a private Cloud Run service from another service, the caller\ngenerates a Google-signed **OpenID Connect (OIDC) ID Token** and passes it in\nthe `Authorization: Bearer \u003CTOKEN>` header.\n\n---\n\n## Validation Checklist\n\n-   [ ] Is the user running code locally? Suggest `gcloud auth\n    application-default login` or **Service Account Impersonation**.\n-   [ ] Is the user attempting to use Service Account keys locally? Strongly\n    discourage this and recommend impersonation.\n-   [ ] Is the user running in production? Recommend attaching a custom,\n    least-privilege service account, NOT using keys.\n-   [ ] Is the user relying on the Compute Engine Default Service Account?\n    Recommend creating a custom service account instead.\n-   [ ] Is the user running on another cloud? Recommend Workload Identity\n    Federation.\n-   [ ] Is the user calling a custom app? Recommend OIDC ID Tokens.\n-   [ ] Has the user restricted their API Keys? Check for appropriate [API Key\n    Restrictions](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fapi-keys#adding-application-restrictions).\n\n## References\n\n-   [Authentication Overview](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication)\n-   [User Identities](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fuser-identities)\n-   [Application Default Credentials](https:\u002F\u002Fdocs.cloud.google.com\u002Fdocs\u002Fauthentication\u002Fprovide-credentials-adc)\n-   [Service Account Best Practices](https:\u002F\u002Fdocs.cloud.google.com\u002Fiam\u002Fdocs\u002Fbest-practices-service-accounts)\n",{"name":5,"metadata":55,"description":7},{"source":56},"google\u002Fskills (Apache 2.0)","main","2b749c82b5d11fac39d9a6e021ce3f5b8a541bd1","cli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fgoogle-cloud-auth",3963,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates","https:\u002F\u002Faitmpl.com","https:\u002F\u002Fgithub.com\u002Fdavila7","https:\u002F\u002Fdanielavila.me","Building AI dev tools with LLMs","2026-11-15 01:32:48",{"source":9,"skillName":5,"commands":68,"prompt":78,"zipAvailable":79},[69,72,75],{"tool":70,"command":71},"npx","npx skills add davila7\u002Fclaude-code-templates --skill google-cloud-auth",{"tool":73,"command":74},"bunx","bunx skills add davila7\u002Fclaude-code-templates --skill google-cloud-auth",{"tool":76,"command":77},"pnpm","pnpm dlx skills add davila7\u002Fclaude-code-templates --skill google-cloud-auth","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fgoogle-cloud-auth\u002FSKILL.md",true,[],[82,108,134,157,197,225],{"skillNo":83,"name":84,"nameZh":17,"description":85,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":50},"01M70NHBTQ8BV0A2SCAZXEPHCX","wealthville-pool-scoring","Score DeFi liquidity pools before providing liquidity. Returns a 0-100 pool score and an Enter\u002FHold\u002FExit\u002FReduce\u002FAvoid verdict with calibrated confidence for ~68,800 Solana pools and 575 EVM pools, plus a public miss-inclusive track record. Use when asked whether a pool is worth LPing into, which pools look best right now, or how accurate the scores have actually been.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fweb-data\u002Fwealthville-pool-scoring\u002FSKILL.md",[],[89,90,91,92,93,49,94,95,96,97,98,99,100,101,102,103,104,105,106,107],"scoring","pool","wealthville pool scoring","liquidity","which","exit","now","use","when","reduce","with","record","track","verdict","evm","solana","how","public","look",{"skillNo":109,"name":110,"nameZh":17,"description":111,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":50},"01M70MB6VR8ERJ4EM8D5KHBMEV","technical-debt-auditor","Scans a codebase and produces a quantified technical debt report with a prioritized remediation plan. Analyzes dead code, TODO\u002FFIXME\u002FHACK markers, dependency staleness, complexity hotspots, code duplication signals, test coverage gaps, unused exports, and outdated patterns. Use this skill when the user asks to audit their codebase for tech debt, wants a health check of their code quality, says things like \"where should I focus refactoring\", \"find code smells\", \"audit my codebase\", \"what technical debt do we have\", \"prioritize cleanup work\", or asks about code quality metrics. Also trigger when the user mentions \"code rot\", \"legacy cleanup\", \"refactoring priorities\", or wants to understand the overall health of a project before a major effort. Trigger even if the user doesn't say \"technical debt\" explicitly — any request to systematically assess code quality and identify improvement priorities belongs here.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdevelopment\u002Ftechnical-debt-auditor\u002FSKILL.md",[],[115,116,117,118,119,120,121,122,123,124,125,97,126,127,128,129,130,131,132,133],"technical debt","debt","technical","technical debt auditor","auditor","coverage","complexity","markers","project","cleanup","unused","code","todo","work","plan","focus","signals","audit","dependency",{"skillNo":135,"name":136,"nameZh":17,"description":137,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":50},"01M70KPYH9QNHCNME5GJQGE22K","readonly-sql-guard","Make an agent's database access provably read-only. Use when an agent runs caller-supplied SQL against a production\u002FERP\u002Fanalytics database (a \"query\" MCP tool, text-to-SQL, an admin console), or when reviewing DB-access code for write\u002FDDL\u002Fside-effect\u002Ftransaction-escape risks. Checks what a statement CALLS, not just its shape.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdatabase\u002Freadonly-sql-guard\u002FSKILL.md",[],[141,142,143,144,145,146,147,49,148,149,150,151,152,153,154,96,41,155,97,156],"readonly","guard","sql guard","sql","readonly sql guard","erp","effect","read-only","db","just","tool","calls","only","MCP","database","query",{"skillNo":158,"name":159,"nameZh":160,"description":161,"descriptionZh":162,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":163,"licenseFileUrl":164,"sourceHtmlUrl":165,"categories":166,"keywords":173,"publishedAt":50},"01M6AFY6F7CC2BBZP1QD6VTNVC","web-artifacts-builder","Claude 网页 Artifact 构建","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","用于创建精细的、多组件的 claude.ai HTML artifact 的工具套件，采用现代前端 Web 技术（React、Tailwind CSS、shadcn\u002Fui）。适用于需要状态管理、路由或 shadcn\u002Fui 组件的复杂 artifact —— 不适用于简单的单文件 HTML\u002FJSX artifact。","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[167,170],{"categoryNo":168,"categoryName":169,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":171,"categoryName":172,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现",[174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,49,196],"artifacts builder","web","web artifacts builder","artifacts","builder","state","routing","state management","component","css","frontend","ui","Tools","file","components","shadcn","react","Tailwind","suite","jsx","html","single-file","ui components",{"skillNo":198,"name":199,"nameZh":200,"description":201,"descriptionZh":202,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":163,"licenseFileUrl":203,"sourceHtmlUrl":204,"categories":205,"keywords":212,"publishedAt":50},"01M6AFWF33SFV9Z3SF4PEEE4BF","webapp-testing","Playwright Web 应用测试","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","使用 Playwright 与本地 Web 应用进行交互和测试的工具包。支持验证前端功能、调试 UI 行为、捕获浏览器截图以及查看浏览器日志。","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[206,209],{"categoryNo":207,"categoryName":208,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":210,"categoryName":211,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[213,214,215,216,217,175,218,184,185,219,220,221,222,49,223,99,224],"webapp testing","testing","webapp","browser","playwright","applications","debugging","toolkit","logs","screenshots","local","behavior",{"skillNo":226,"name":227,"nameZh":228,"description":229,"descriptionZh":230,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":163,"licenseFileUrl":231,"sourceHtmlUrl":232,"categories":233,"keywords":240,"publishedAt":50},"01M6AF67Q67JJJ5V51JR2P52KA","discernment-nudge","回复事实核查追问","After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.","在你给出用户可能据以行动的实质性答案或草稿之后——建议或推荐、起草的工件（如目标、计划、推介、提案或电子邮件）、估计或预测、数据分析或解读、他们可能依赖的事实声明，或多步骤论证——在最终确定回复之前调用本技能，然后，如适用，附加 2-3 个简短的后续问题，每个问题都与你刚刚产出的具体内容相关，帮助用户核查关键事实、探究推理或假设，并注意到缺失的上下文。每次对话最多执行一次。当用户询问琐碎的操作方法或简单查找、想要纯教育性解释、仅要求根据提供的内容格式化\u002F转换\u002F组装文件、正在编写将要运行的代码、正在进行创意写作或休闲聊天，或已经要求你复核、引用或审查时跳过——技能文件解释了这些边界和确切的输出格式。","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FSKILL.md",[234,237],{"categoryNo":235,"categoryName":236,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQ6TMSBZZX4V1THHNVC815","回答复核",{"categoryNo":238,"categoryName":239,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BS5011KJDVSRXG1DC4P666","普通用户",[241,242,243,244,245,246,247,248,177,249,187,126,250,251,252,253,254,153,255,97,256,257,258,259,260,105,261],"discernment nudge","nudge","interpretation","help","run","reasoning","data","writing","lookup","content","review","conversation","short","up","invoke","you","analysis","claims","argument","assemble","recommendations"]