gcloud CLI를 사용하여 API를 호출하는 경우 gcloud CLI 구성에서 할당량 프로젝트를 설정할 수 있습니다.
gcloud config set billing/quota_project YOUR_PROJECT
REST 또는 RPC API를 직접 호출하는 경우 x-goog-user-project HTTP 헤더를 사용해서 각 요청에 할당량 프로젝트를 지정합니다. 자세한 내용은 REST 요청으로 할당량 프로젝트 설정을 참조하세요.
결제 프로젝트로 지정할 수 있으려면 결제 프로젝트에 대해 serviceusage.services.use IAM 권한이 있어야 합니다. serviceusage.services.use 권한은 Service Usage Consumer IAM 역할에 포함되어 있습니다. 프로젝트에 대해 serviceusage.services.use 권한이 없으면 보안 관리자 또는 프로젝트에서 서비스 사용 소비자 역할을 부여할 수 있는 프로젝트 소유자에게 문의하세요.
사용자 인증 정보가 필요한 액세스를 제공하는 것으로 보이지 않거나 찾을 수 없는 경우 다음을 확인하세요.
로컬 환경에서 gcloud CLI를 사용하여 Google Cloud 에 액세스하는 경우 사용 중인 사용자 인증 정보를 알아야 합니다.
gcloud CLI를 사용할 때는 gcloud auth login 명령어를 사용하여 gcloud CLI에 제공한 사용자 인증 정보를 사용합니다. ADC에 제공한 사용자 인증 정보는 사용하지 않습니다. 이러한 두 가지 사용자 인증 정보 세트에 대한 자세한 내용은 gcloud CLI 인증 구성 및 ADC 구성을 참조하세요.
서비스 계정 키 또는 다른 JSON 파일을 ADC에 사용하는 경우에만GOOGLE_APPLICATION_CREDENTIALS 환경 변수가 설정되어 있는지 확인합니다.
환경 변수에서 가리키는 사용자 인증 정보가 GKE용 워크로드 아이덴티티 제휴의 사용자 인증 정보를 포함하여 다른 사용자 인증 정보보다 우선시 됩니다.
요청을 수행하는 주 구성원에게 필요한 IAM 역할이 있는지 확인합니다. 사용자 인증 정보를 사용하는 경우 사용자 계정과 관련된 이메일 주소에 역할을 부여해야 합니다. 서비스 계정을 사용하는 경우 서비스 계정에 필요한 역할이 있어야 합니다.
API 요청에 API 키를 제공하는 경우 API 키가 다른 위치의 ADC보다 우선합니다. GOOGLE_APPLICATION_CREDENTIALS 환경 변수를 설정했고 API 키를 사용하는 경우 API에서 사용자가 ADC에 제공된 사용자 인증 정보가 무시된다는 경고가 반환될 수 있습니다. 경고를 중지하려면 GOOGLE_APPLICATION_CREDENTIALS 환경 변수를 설정 해제합니다.
인식할 수 없는 사용자 인증 정보 유형
API 요청에서 Error creating credential
from JSON. Unrecognized credential type이 포함된 오류를 반환하면 유효한 사용자 인증 정보를 사용하고 있는지 확인합니다. 클라이언트 ID 파일은 ADC에 대한 사용자 인증 정보를 제공하는 데 지원되지 않습니다.
서비스 계정 가장으로 인해 로컬 사용자 인증 정보에 반환된 오류
서비스 계정 가장을 사용하여 생성된 로컬 ADC 파일의 사용자 인증 정보는 일부 인증 라이브러리에서만 지원됩니다. 호출에서 Neither metadata server or valid service
account credentials are found와 유사한 오류를 반환하면 이 태스크에 로컬 가장 사용자 인증 정보를 사용할 수 없습니다.
이 오류를 방지하려면 사용자 인증 정보에서 ADC 파일을 만들거나 메타데이터 서버를 사용할 수 있는 환경(예: Compute Engine)에서 코드를 실행합니다.
요청에 사용된 알 수 없는 프로젝트 764086051850
프로젝트 764086051850은 gcloud CLI에서 사용하는 프로젝트입니다. 이 프로젝트를 참조하는 인증 오류가 표시되면 클라이언트 기반 API를 사용하려는 것이며 구성에 프로젝트와 할당량 프로젝트를 모두 설정하지 않은 것입니다.
로컬 ADC 파일을 만들려고 할 때 This app
is blocked 또는 Access blocked: Authorization Error와 유사한 오류가 반환되면 기본 ADC 설정 명령어에서 지원하지 않는 범위를 사용하려고 한 것일 수 있습니다. 일반적으로 이 문제는 Google Drive와 같이 Google Cloud외부에 있는 애플리케이션에 범위를 추가하면 발생합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThis page covers common issues encountered when using Application Default Credentials (ADC), including problems with user credentials, incorrect credentials, unrecognized credential types, errors with service account impersonation, quota project issues, and access blocked by scopes.\u003c/p\u003e\n"],["\u003cp\u003eWhen using client-based APIs with user credentials, a quota project must be specified for billing and quota purposes; this can be set through the ADC file, the gcloud CLI config, or the \u003ccode\u003ex-goog-user-project\u003c/code\u003e HTTP header.\u003c/p\u003e\n"],["\u003cp\u003eIf user credentials are not working, ensure that the API is enabled in the specified project, and that the user has the \u003ccode\u003eserviceusage.services.use\u003c/code\u003e IAM permission or the Service Usage Consumer role.\u003c/p\u003e\n"],["\u003cp\u003eWhen troubleshooting credential access problems, confirm that the correct credentials are being used, the \u003ccode\u003eGOOGLE_APPLICATION_CREDENTIALS\u003c/code\u003e environment variable is set appropriately, the requesting principal has the required IAM roles, and that an API key isn't overriding ADC.\u003c/p\u003e\n"],["\u003cp\u003eIf you receive an "Access blocked" error when creating a local ADC file, check if you're using scopes unsupported by the default ADC setup, and if necessary, use an OAuth Client ID to add scopes for non-Google Cloud services.\u003c/p\u003e\n"]]],[],null,["This page describes some common problems you might encounter when using\nApplication Default Credentials (ADC).\n\nFor information about how ADC works, including where credentials are found, see\n[How Application Default Credentials works](/docs/authentication/application-default-credentials).\n\nUser credentials not working\n\nIf your API request returns an error message about user credentials not being\nsupported by this API, the API not being enabled in the project, or no quota\nproject being set, review the following information.\n\nThere are two kinds of Google Cloud APIs:\n\n- *Resource-based APIs*, which use the project associated with the resources\n being accessed for billing and quota.\n\n- *Client-based APIs*, which use the project associated with the client\n accessing the resources for billing and quota.\n\nWhen you provide user credentials to authenticate to a client-based API, you\nmust specify the project to use for billing and quota. This project is called\nthe *quota project*.\n\nThere are a number of ways to specify a quota project, including the following\noptions:\n\n- Update your ADC file to use a different project as the quota project:\n\n ```\n gcloud auth application-default set-quota-project YOUR_PROJECT\n ```\n- If you are using the gcloud CLI to call the API, you can set\n your quota project in your gcloud CLI config:\n\n ```\n gcloud config set billing/quota_project YOUR_PROJECT\n ```\n- If you are calling the REST or RPC API directly, use the\n `x-goog-user-project` HTTP header to specify a quota project in each\n request. For details, see\n [Set the quota project with a REST request](/docs/authentication/rest#set-billing-project).\n\n| **Note:** The API you are trying to use must be enabled in whatever project you specify.\n\n\nYou must have the `serviceusage.services.use` IAM permission for\na project to be able to designate it as your billing project. The\n`serviceusage.services.use` permission is included in the Service Usage Consumer\nIAM role. If you don't have the `serviceusage.services.use`\npermission for any project, contact your security administrator or a project\nowner who can give you the Service Usage Consumer role in the project.\n\nFor more information about quota projects, see\n[Quota project overview](/docs/quotas/quota-project). For information about additional ways\nto set the quota project, see [Set the quota project](/docs/quotas/set-quota-project).\n\nIncorrect credentials\n\nIf your credentials don't seem to be providing the access you expect, or aren't\nfound, check the following:\n\n- If you are using the gcloud CLI to access Google Cloud in a\n local environment, make sure you understand which credentials you are using.\n When you use the gcloud CLI, you are using the credentials you\n provided to the gcloud CLI by using the `gcloud auth login`\n command. You are not using the credentials you provided to ADC. For more\n information about these two sets of credentials, see\n [gcloud CLI authentication configuration and ADC configuration](/docs/authentication/gcloud#gcloud-credentials).\n\n- Make sure that the `GOOGLE_APPLICATION_CREDENTIALS` environment variable is\n set *only* if you are using a service account key or other JSON file for ADC.\n The credentials pointed to by the environment variable take precedence over\n other credentials, including for Workload Identity Federation for GKE.\n\n- Confirm that the principal making the request has the required\n IAM roles. If you are using user credentials, then the roles\n must be granted to the email address associated with the user account. If\n you are using a service account, then that service account must have the\n required roles.\n\n- If you provide an API key with the API request, the API key takes precedence\n over ADC in any location. If you have set the `GOOGLE_APPLICATION_CREDENTIALS`\n environment variable and you are using an API key, the API might return a\n warning telling you that the credentials you provided to ADC are being\n ignored. To stop the warning, unset the `GOOGLE_APPLICATION_CREDENTIALS`\n environment variable.\n\nUnrecognized credential type\n\nIf your API request returns an error that includes `Error creating credential\nfrom JSON. Unrecognized credential type`, make sure you are using a valid\ncredential. Client ID files are not supported to provide credentials for ADC.\n\nError returned for local credentials from service account impersonation\n\nCredentials from a local ADC file generated by using service account\nimpersonation are not supported by all of the authentication libraries. If your\ncall returns an error similar to `Neither metadata server or valid service\naccount credentials are found`, you can't use local impersonated credentials for\nthis task.\n\nTo avoid this error, create your ADC file from your user credentials or run your\ncode in an environment that has a metadata server available (such as\nCompute Engine).\n\nUnknown project `764086051850` used for request\n\nProject `764086051850` is the project used by the gcloud CLI. If you\nsee authentication errors referencing this project, you are trying to use\na client-based API and you have not set both your project and your quota\nproject for your configuration.\n\nFor more information, see [User credentials not working](#user-creds-client-based).\n\nAccess blocked when using scopes\n\nWhen you attempt to create a local ADC file, and an error similar to `This app\nis blocked` or `Access blocked: Authorization Error` is returned, you might be\nattempting to use scopes that aren't supported by the\n[default ADC setup command](/docs/authentication/set-up-adc-local-dev-environment#google-idp). Typically, this issue is caused by\nadding scopes for applications outside of Google Cloud, such as Google\nDrive.\n\n\nBy default, the access tokens generated from a local ADC file created with user credentials include\nthe [cloud-wide scope `https://www.googleapis.com/auth/cloud-platform`](/docs/authentication#authorization-gcp).\nTo specify scopes explicitly, you use the\n[`---scopes` flag](/sdk/gcloud/reference/auth/application-default/login#--scopes)\nwith the `gcloud auth application-default login` command.\n\n\nTo add scopes for services outside of Google Cloud, such as Google Drive,\n[create an OAuth Client ID](https://support.google.com/cloud/answer/6158849)\nand provide it to the `gcloud auth application-default login` command by using the\n[`---client-id-file` flag](/sdk/gcloud/reference/auth/application-default/login#--client-id-file), specifying\nyour scopes with the [`---scopes` flag](/sdk/gcloud/reference/auth/application-default/login#--scopes)."]]