8000 Add audiences to the auth method sample (#452) · asndev/python-docs-samples@79ff40c · GitHub
[go: up one dir, main page]

Skip to content

Commit 79ff40c

Browse files
saicheemsJon Wayne Parrott
authored andcommitted
Add audiences to the auth method sample (GoogleCloudPlatform#452)
1 parent 2c897d0 commit 79ff40c

File tree

1 file changed

+3
-1
lines changed
  • appengine/standard/endpoints-frameworks-v2/backend

1 file changed

+3
-1
lines changed

appengine/standard/endpoints-frameworks-v2/backend/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ def echo(self, request):
5353
path='echo/getUserEmail',
5454
http_method='GET',
5555
# Require auth tokens to have the following scopes to access this API.
56-
scopes=[endpoints.EMAIL_SCOPE])
56+
scopes=[endpoints.EMAIL_SCOPE],
57+
# OAuth2 audiences allowed in incoming tokens.
58+
audiences='your-oauth-client-id.com')
5759
def get_user_email(self, request):
5860
user = endpoints.get_current_user()
5961
# If there's no user defined, the request was unauthenticated, so we

0 commit comments

Comments
 (0)
0