Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa9bd5e

Browse files
author
Mohan Krishnan
authored
Fix the call to validate_iap (GoogleCloudPlatform#4260) (GoogleCloudPlatform#4466)
The method signature for validate_iap changed with 41c173 but the call to validate_iap from example_gce_backend.py was not changed
1 parent 2c0d10c commit aa9bd5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

iap/example_gce_backend.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ def root():
2929
jwt = flask.request.headers.get('x-goog-iap-jwt-assertion')
3030
if jwt is None:
3131
return 'Unauthorized request.'
32+
expected_audience = '/projects/{}/global/backendServices/{}'.format(CLOUD_PROJECT_ID, BACKEND_SERVICE_ID)
3233
user_id, user_email, error_str = (
3334
validate_jwt.validate_iap_jwt(
34-
jwt, CLOUD_PROJECT_ID, BACKEND_SERVICE_ID))
35+
jwt, expected_audience))
3536
if error_str:
3637
return 'Error: {}'.format(error_str)
3738
else:

0 commit comments

Comments
 (0)