File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
endpoints/getting-started
clients/service_to_service_google_id_token Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 24
24
from google .appengine .api import app_identity
25
25
import webapp2
26
26
27
- DEFAUTL_SERVICE_ACCOUNT = "YOUR-CLIENT-PROJECT-ID@appspot.gserviceaccount.com"
27
+ SERVICE_ACCOUNT_EMAIL = "YOUR-CLIENT-PROJECT-ID@appspot.gserviceaccount.com"
28
28
HOST = "YOUR-SERVER-PROJECT-ID.appspot.com"
29
- TARGET_AUD = "YOUR-SERVER-PROJECT-ID@appspot.gserviceaccount .com"
29
+ TARGET_AUD = "https:// YOUR-SERVER-PROJECT-ID.appspot .com"
30
30
31
31
32
32
def generate_jwt ():
@@ -42,11 +42,10 @@ def generate_jwt():
42
42
"iat" : now ,
43
43
# expires after one hour.
44
44
"exp" : now + 3600 ,
45
- # iss is the Google App Engine default service account email.
46
- "iss" : DEFAUTL_SERVICE_ACCOUNT ,
47
- # scope must match 'audien
C5A9
ce' for google_id_token in the security
48
- # configuration in your swagger spec.
49
- "scope" : TARGET_AUD ,
45
+ # iss is the service account email.
46
+ "iss" : SERVICE_ACCOUNT_EMAIL ,
47
+ # target_audience is the URL of the target service.
48
+ "target_audience" : TARGET_AUD ,
50
49
# aud must be Google token endpoints URL.
51
50
"aud" : "https://www.googleapis.com/oauth2/v4/token"
52
51
})
Original file line number Diff line number Diff line change @@ -141,8 +141,8 @@ securityDefinitions:
141
141
authorizationUrl : " "
142
142
flow : " implicit"
143
143
type : " oauth2"
144
- x-google-issuer : " accounts.google.com"
145
- x-google-jwks_uri : " https://www.googleapis.com/oauth2/v1 /certs"
144
+ x-google-issuer : " https:// accounts.google.com"
145
+ x-google-jwks_uri : " https://www.googleapis.com/oauth2/v3 /certs"
146
146
# Your OAuth2 client's Client ID must be added here. You can add multiple client IDs to accept tokens form multiple clients.
147
147
x-google-audiences : " YOUR-CLIENT-ID"
148
148
# This section configures authentication using Firebase Auth.
You can’t perform that action at this time.
0 commit comments