You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
google.auth.transport.Request is called with type(body) == str #318
Activity
SurferJeffAtGoogle commentedon Oct 22, 2019
@Nikratio Thank you for reporting this issue. I apologize for the late reply. I clicked on the link https://google-auth.readthedocs.io/en/latest/reference/google.auth.html#google.auth.default, and I don't see a discussion of a body parameter or bytes.
Is this issue still reproducible today? Is there another doc that describes the conflict between the docs and the code?
busunkim96 commentedon Oct 22, 2019
The link may have changed since the issue was posted:
google.auth.transport.Requestdocumentation says that the body should have type byteshttps://google-auth.readthedocs.io/en/latest/reference/google.auth.transport.html#google.auth.transport.Request

Investigation (in progress):
_token_endpoint_requestis a private method that makes a request using parameterbodygoogle-auth-library-python/google/oauth2/_client.py
Lines 83 to 91 in 137b43b
All the public methods that call it specify parameter type
strfor the values that are used to make the body.google-auth-library-python/google/oauth2/_client.py
Lines 118 to 138 in 137b43b
google.auth.transport.Request calls
requests.Sesion.request.google-auth-library-python/google/auth/transport/requests.py
Lines 94 to 124 in 137b43b
fix: always pass body of type bytes to `google.auth.transport.Request` (