Skip to content

JWT auth error in jwt_token_gen.py and bookstore_client.py under python3 #4340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wwuck opened this issue Jul 21, 2020 · 1 comment · Fixed by #4342
Closed

JWT auth error in jwt_token_gen.py and bookstore_client.py under python3 #4340

wwuck opened this issue Jul 21, 2020 · 1 comment · Fixed by #4342
Assignees
Labels
triage me I really want to be triaged.

Comments

@wwuck
Copy link
Contributor

wwuck commented Jul 21, 2020

In which file did you encounter the issue?

https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/endpoints/bookstore-grpc/jwt_token_gen.py

Did you change the file? If so, how?

Yes, updated to run .decode('utf-8') on the signed_jwt before it is printed to stdout.

Describe the issue

Running the sample from https://cloud.google.com/endpoints/docs/grpc/service-account-authentication, and also reading the documentation at https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/endpoints/bookstore-grpc/README.md#generating-a-jwt-token-from-a-service-account-file. They state that the output from jwt_token_gen.py
can be used directly as input into bookstore_client.py --auth_token.

This works fine for python2 but is broken in python3 as the output of jwt_token_gen.py now wraps the token with b'<token>' under python3.

There was a similar bug report for another sample client file at #1958.

@wwuck wwuck changed the title JWT auth error in bookstore_client.py under python3 JWT auth error in jwt_token_gen.py and bookstore_client.py under python3 Jul 21, 2020
@tmatsuo tmatsuo assigned ace-n and unassigned tmatsuo Jul 21, 2020
@ace-n
Copy link

ace-n commented Jul 21, 2020

@tmatsuo I'm not sure who the right person for this is, but I don't work on endpoints anymore.

Maybe @simonz130 knows?

@ace-n ace-n removed their assignment Jul 21, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jul 21, 2020
@tmatsuo tmatsuo self-assigned this Jul 22, 2020
tmatsuo pushed a commit that referenced this issue Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants