I have two Google OAuth applications. One is used for testing and hits a sandbox account. The other just got verified for production use and is hitting our production account.
The sandbox version is working just fine. The same code fails on the production version.
When I try to call the new Google Ads API using the production version, I'm getting:
google.ads.googleads.errors.GoogleAdsException: (<_SingleThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNAUTHENTICATED
details = "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project."
debug_error_string = "{"created":"@1644245725.347305819","description":"Error received from peer ipv4:142.250.73.202:443","file":"src/core/lib/surface/call.cc","file_line":1074,"grpc_message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","grpc_status":16}"
>, <_SingleThreadedRendezvous of RPC that terminated with:
status = StatusCode.UNAUTHENTICATED
details = "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project."
debug_error_string = "{"created":"@1644245725.347305819","description":"Error received from peer ipv4:142.250.73.202:443","file":"src/core/lib/surface/call.cc","file_line":1074,"grpc_message":"Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","grpc_status":16}"
>, errors {
error_code {
authentication_error: AUTHENTICATION_ERROR
}
message: "Authentication of the request failed."
}
request_id: "fPZpK5epSvpfmvbC3luD-w"
, 'fPZpK5epSvpfmvbC3luD-w')
When I try to call the old Google AdWords API with the production version, I'm getting:
googleads.errors.AdWordsReportBadRequestError: Type: QuotaCheckError.INVALID_TOKEN_HEADER
I've verified the client id, client secret, token and refresh token and it matches what I used / got when I went through the Oauth process (i.e., I'm not mixing the sandbox and production credentials).
The only noticeable difference between the sandbox and production credentials is that the token is much longer for production (163 characters for production; only 22 for sandbox)
Thanks for your help,
Walter