Google Cloud외부에서 애플리케이션을 실행하는 경우 Google Cloud 에서 인식된 사용자 인증 정보를 제공하여 Google Cloud 서비스를 사용해야 합니다.
워크로드 아이덴티티 제휴
외부 IdP의 사용자 인증 정보를 사용하여 Google Cloud 에 인증하는 데 선호되는 방법은 워크로드 아이덴티티 제휴를 사용하는 것입니다. 사용자 인증 정보 구성 파일을 만들고 GOOGLE_APPLICATION_CREDENTIALS 환경 변수에서 이를 가리키도록 설정합니다. 이 방법은 서비스 계정 키를 만드는 것보다 안전합니다.
워크로드 아이덴티티 제휴를 구성할 수 없으면 서비스 계정을 만들고, 여기에 애플리케이션에 필요한 IAM 역할을 부여하고, 서비스 계정에 대해 키를 만들어야 합니다.
서비스 계정 키를 만들고 이를 ADC에 제공하려면 다음 안내를 따르세요.
서비스 계정 키 만들기의 안내에 따라 애플리케이션에 필요한 역할, 서비스 계정에 대한 키를 사용하여 서비스 계정을 만듭니다.
Set the environment variable GOOGLE_APPLICATION_CREDENTIALS
to the path of the JSON file that contains your credentials.
This variable applies only to your current shell session, so if you open
a new session, set the variable again.
Example: Linux or macOS
exportGOOGLE_APPLICATION_CREDENTIALS="KEY_PATH"
Replace KEY_PATH with the path of the JSON file that contains your credentials.
[[["이해하기 쉬움","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-03-26(UTC)"],[[["If running applications outside of Google Cloud, you need to provide credentials recognized by Google Cloud to access its services."],["Workload Identity Federation is the recommended method for authenticating with Google Cloud using external credentials, as it is more secure than service account keys."],["If Workload Identity Federation is not feasible, service account keys can be used, but they pose a security risk and should be avoided if possible."],["To use service account keys, create a service account with the necessary roles, generate a key, and set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the key file's path."],["The `GOOGLE_APPLICATION_CREDENTIALS` environment variable directs Application Default Credentials (ADC) to the specified credential location, and it takes precedence over other credential locations."]]],[]]