Mengaktifkan akses berbasis sertifikat di aplikasi klien
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan cara mengaktifkan akses berbasis sertifikat (CBA) di aplikasi klien Anda untuk memanggil Google API menggunakan library atau alat yang kompatibel.
Untuk mengaktifkan CBA dan mengizinkan Google API mengidentifikasi perangkat, klien pemanggil
harus membuat koneksi mTLS dengan Google API, lalu menemukan
sertifikat TLS di perangkat. Proses ini diilustrasikan dalam diagram
berikut:
Klien yang kompatibel dengan CBA
Anda dapat menggunakan CBA dengan klien berikut:
Google Cloud console (Chrome)
Google Cloud CLI Versi 264.0.0 atau yang lebih baru
Terraform CLI Versi 1.3.6 atau yang lebih baru
Library Klien Google API
Python
Golang
Mengaktifkan CBA untuk gcloud CLI
Minta pengguna Anda untuk menginstal atau mengupdate gcloud CLI untuk memastikan mereka memiliki versi yang berfungsi dengan CBA, Versi 264.0.0 atau yang lebih baru.
Pengguna yang telah menginstal Google Cloud CLI dapat mengonfirmasi bahwa mereka memiliki Versi 264.0.0 atau yang lebih baru menggunakan perintah berikut:
gcloud --version
Jika perlu, pengguna dapat mengupdate versi Google Cloud CLI menggunakan perintah berikut:
gcloud components
Untuk mulai menggunakan CBA, pengguna harus menjalankan perintah berikut:
gcloud config set context_aware/use_client_certificate true
Mengaktifkan CBA untuk Terraform CLI dan Library Klien Google API
Untuk mengaktifkan CBA untuk Terraform CLI dan Library Klien Google API, pengguna harus menetapkan variabel lingkungan berikut:
exportGOOGLE_API_USE_CLIENT_CERTIFICATE=1
Mengaktifkan CBA untuk Desktop IAP
Untuk mengaktifkan akses berbasis sertifikat di Desktop IAP, lakukan hal berikut:
Di aplikasi, pilih Tools > Options.
Pilih Koneksi aman ke Google Cloud menggunakan akses berbasis sertifikat.
Klik Oke.
Tutup Desktop IAP dan luncurkan lagi.
Jika menggunakan Active Directory, Anda juga dapat mengonfigurasi objek kebijakan grup
untuk mengaktifkan akses berbasis sertifikat secara otomatis bagi pengguna.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-05 UTC."],[],[],null,["# Enable certificate-based access in client applications\n\nThis page describes how to enable certificate-based access (CBA) in your client\napplications for calling the Google APIs using compatible\nlibraries or tools.\n\nTo enable CBA and allow the Google APIs to identify a device, the caller client\nmust establish mTLS connections with the Google APIs, and then discover\nthe TLS certificates on the device. This process is illustrated in the following\ndiagram:\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n### CBA compatible clients\n\nYou can use CBA with the following clients:\n\n- Google Cloud console (Chrome)\n- Google Cloud CLI Version 264.0.0 or later\n- Terraform CLI Version 1.3.6 or later\n- Google API Client Libraries\n - Python\n - Golang\n\nEnable CBA for the gcloud CLI\n-----------------------------\n\n1. Have your users\n [install](/sdk/docs/install) or update the\n gcloud CLI to ensure they have a version that works with CBA, Version\n 264.0.0 or later.\n\n Users who have the Google Cloud CLI installed can confirm they have Version\n 264.0.0 or later using the following command: \n\n gcloud --version\n\n If needed, users can update their Google Cloud CLI version using the following\n command: \n\n gcloud components\n\n2. To begin using CBA, users must run the following command:\n\n gcloud config set context_aware/use_client_certificate true\n\nEnable CBA for the Terraform CLI and Google API Client Libraries\n----------------------------------------------------------------\n\n1. To enable CBA for the Terraform CLI and Google API Client Libraries,\n users must set the following environment variable:\n\n export GOOGLE_API_USE_CLIENT_CERTIFICATE=1\n\nEnable CBA for IAP Desktop\n--------------------------\n\nTo enable certificate-based access in IAP Desktop, do the following:\n\n1. In the application, select **Tools** \\\u003e **Options**.\n2. Select **Secure connections to Google Cloud by using certificate-based access**.\n3. Click **OK**.\n4. Close IAP Desktop and launch it again.\n\nIf you're using Active Directory, you can also [configure a group policy object](https://github.com/GoogleCloudPlatform/iap-desktop/wiki/Managing-IAP-Desktop-using-group-policies#customizing-iap-desktop)\nto automatically enable certificate-based access for your users."]]