File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
endpoints/getting-started/clients Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,15 @@ def generate_jwt(service_account_file):
48
48
# swagger spec. It can be any string.
49
49
'aud' : 'echo.endpoints.sample.google.com' ,
50
50
# iss must match 'issuer' in the security configuration in your
51
- # swagger spec. It can be any string.
51
+ # swagger spec (e.g. service account email) . It can be any string.
52
52
'iss' : 'jwt-client.endpoints.sample.google.com' ,
53
53
# sub and email are mapped to the user id and email respectively.
54
- 'sub' : '12345678' ,
54
+ # sub should match 'iss'
55
+ 'sub' : 'jwt-client.endpoints.sample.google.com' ,
55
56
'email' : 'user@example.com'
56
57
}
57
58
58
- jwt = google .auth .jwt .encode (signer , payload )
59
+ jwt = google .auth .jwt .encode (signer , payload ). decode ( 'UTF-8' )
59
60
60
61
return jwt
61
62
You can’t perform that action at this time.
0 commit comments