8000 Fix audience (#4336) · lak2142/python-docs-samples@cbe2b1a · GitHub
[go: up one dir, main page]

Skip to content

Commit cbe2b1a

Browse files
authored
* Restored needed env var * Typos * Use standard env var
1 parent be79e9c commit cbe2b1a

File tree

1 file changed

+3
-2
lines changed
  • appengine/standard/firebase/firenotes/backend

1 file changed

+3
-2
lines changed

appengine/standard/firebase/firenotes/backend/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import logging
16+
import os
1617

1718
from flask import Flask, jsonify, request
1819
import flask_cors
@@ -72,7 +73,7 @@ def list_notes():
7273
# [START gae_python_verify_token]
7374
id_token = request.headers['Authorization'].split(' ').pop()
7475
claims = google.oauth2.id_token.verify_firebase_token(
75-
id_token, HTTP_REQUEST)
76+
id_token, HTTP_REQUEST, audience=os.environ.get('GOOGLE_CLOUD_PROJECT'))
7677
if not claims:
7778
return 'Unauthorized', 401
7879
# [END gae_python_verify_token]
@@ -95,7 +96,7 @@ def add_note():
9596
# Verify Firebase auth.
9697
id_token = request.headers['Authorization'].split(' ').pop()
9798
claims = google.oauth2.id_token.verify_firebase_token(
98-
id_token, HTTP_REQUEST)
99+
id_token, HTTP_REQUEST, audience=os.environ.get('GOOGLE_CLOUD_PROJECT'))
99100
if not claims:
100101
return 'Unauthorized', 401
101102

0 commit comments

Comments
 (0)
0