When users cancel authorization in Google Security,When the api calls the 
interface, it will always execute 
com.google.auth.oauth2.UserCredentials.doRefreshAccessToken circularly, 
which causes me to not catch this error to modify the authorization status 
saved in the local database. How to deal with this problem.
The following is the stack of loop execution:
Request
-------
MethodName: 
google.ads.googleads.v10.services.CustomerService/ListAccessibleCustomers
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=1, 
x-goog-api-client=gl-java/1.8.0_341 gccl/17.0.1 gapic/17.0.1 gax/2.6.1 
grpc/1.41.0}
Body: 

Response
--------
Headers: null
Body: null
Failure message: null
Status: Status{code=UNAVAILABLE, description=Credentials failed to obtain 
metadata, cause=com.google.api.client.http.HttpResponseException: 400 Bad 
Request
POST https://oauth2.googleapis.com/token
{
  "error": "invalid_grant",
  "error_description": "Token has been expired or revoked."
}
    at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1116)
    at 
com.google.auth.oauth2.UserCredentials.doRefreshAccessToken(UserCredentials.java:273)
    at 
com.google.auth.oauth2.UserCredentials.refreshAccessToken(UserCredentials.java:190)
    at 
com.google.auth.oauth2.OAuth2Credentials$1.call(OAuth2Credentials.java:257)
    at 
com.google.auth.oauth2.OAuth2Credentials$1.call(OAuth2Credentials.java:254)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:750)
}.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/2cb00acd-91d7-4904-8624-54dda387dddfn%40googlegroups.com.
  • On... keji dianfei
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to