アプリケーションのデフォルト認証情報を設定する
Cloud クライアント ライブラリ、Google API クライアント ライブラリ、REST API と RPC API で使用するアプリケーションのデフォルト認証情報(ADC)を設定する方法は、コードが実行されている環境によって異なります。
ADC が認証情報を探す場所と順序については、アプリケーションのデフォルト認証情報の仕組みをご覧ください。
API キーを使用している場合は、ADC を設定する必要はありません。詳細については、API キーを使用して API にアクセスするをご覧ください。
ADC に認証情報を指定する
コードが実行されている環境を選択します。
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-01 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-01 UTC。"],[[["Application Default Credentials (ADC) setup varies depending on the environment where your code is executed."],["ADC is used by Cloud Client Libraries, Google API Client Libraries, and REST and RPC APIs, but API keys do not require ADC setup."],["ADC setup instructions are provided for local development, resources with attached service accounts, containerized environments, on-premises or other cloud providers, and cloud-based development environments."],["You can review documentation to better understand the order in which ADC finds credentials."],["You can find further documentation on authenticating using cloud client libraries, REST, and other authentication methods."]]],[]]