Replace YOUR_SERVICE_ACCOUNT_EMAIL with your
service account email.
Replace YOUR_AUDIENCE with the value in the aud
field sent by the calling service.
In each API method where you want to check for proper authentication,
check for a valid User and raise error 401if there isn't one, as
shown in this sample method definition:
user=endpoints.get_current_user()# If there's no user defined, the request was unauthenticated, so we# raise 401 Unauthorized.
Deploy the API. You need to
redeploy the API whenever you add new clients.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-21 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."]]],[]]