Ganti YOUR_SERVICE_ACCOUNT_EMAIL dengan email akun layanan Anda.
Ganti YOUR_AUDIENCE dengan nilai di kolom aud
yang dikirim oleh layanan panggilan.
Di setiap metode API tempat Anda ingin memeriksa autentikasi yang tepat,
periksa User yang valid dan tampilkan error 401 jika tidak ada, seperti
yang ditunjukkan dalam contoh definisi metode ini:
user=endpoints.get_current_user()# If there's no user defined, the request was unauthenticated, so we# raise 401 Unauthorized.
Men-deploy API. Anda perlu
men-deploy ulang API setiap kali menambahkan klien baru.
[[["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-04-09 UTC."],[[["This guide details how to configure authentication for an API using a service account within a Google Cloud project."],["Authentication setup requires importing the App Engine Endpoints API and adding an issuer object to the API decorator, including details of the service account."],["Each API method should check for a valid user, raising a 401 error if no user is found, to ensure proper authentication."],["You must redeploy the API after you configure the initial setup, and also after adding new clients to the API."]]],[]]