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 2424from google .appengine .api import app_identity
2525import webapp2
2626
27- DEFAUTL_SERVICE_ACCOUNT = "[email protected] " 27+ SERVICE_ACCOUNT_EMAIL = "[email protected] " 2828HOST = "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"
3030
3131
3232def generate_jwt ():
@@ -42,11 +42,10 @@ def generate_jwt():
4242 "iat" : now ,
4343 # expires after one hour.
4444 "exp" : now + 3600 ,
45- # iss is the Google App Engine default service account email.
46- "iss" : DEFAUTL_SERVICE_ACCOUNT ,
47- # scope must match 'audience' 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 ,
5049 # aud must be Google token endpoints URL.
5150 "aud" : "https://www.googleapis.com/oauth2/v4/token"
5251 })
Original file line number Diff line number Diff line change @@ -141,8 +141,8 @@ securityDefinitions:
141141 authorizationUrl : " "
142142 flow : " implicit"
143143 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"
146146 # Your OAuth2 client's Client ID must be added here. You can add multiple client IDs to accept tokens form multiple clients.
147147 x-google-audiences : " YOUR-CLIENT-ID"
148148 # This section configures authentication using Firebase Auth.
You can’t perform that action at this time.
0 commit comments