Ersetzen Sie YOUR_SERVICE_ACCOUNT_EMAIL durch die E-Mail-Adresse Ihres Dienstkontos.
Ersetzen Sie YOUR_AUDIENCE durch den vom aufrufenden Dienst gesendeten Wert im Feld aud.
Prüfen Sie in jeder API-Methode, mit der Sie eine ordnungsgemäße Authentifizierung gewährleisten möchten, ob ein gültiger User vorhanden ist. Wenn dies nicht der Fall ist, geben Sie wie in der folgenden Methodendefinition beispielhaft gezeigt den Fehler 401 aus:
user=endpoints.get_current_user()# If there's no user defined, the request was unauthenticated, so we# raise 401 Unauthorized.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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."]]],[]]