Credential could not be refreshed, "error" : "invalid_grant", "error_description" : "Bad Request"

333 views
Skip to first unread message

dudoa...@gmail.com

unread,
Jan 28, 2021, 11:48:40 PM1/28/21
to AdWords API and Google Ads API Forum
We receive error "Credential could not be refreshed" when sending request to get report data. Please help me to clear this issue, why did this issue happend and how can we need handle it?

Response error
jp.co.everrise.batch.error.GetReportException: com.google.api.ads.common.lib.exception.OAuthException: Credential could not be refreshed.
at jp.co.everrise.batch.service.GetReportAdwordsService.<init>(GetReportAdwordsService.java:50)
at jp.co.everrise.batch.multitasking.DownloadReportAdword.run(DownloadReportAdword.java:71)
Caused by: com.google.api.ads.common.lib.exception.OAuthException: Credential could not be refreshed.
at com.google.api.ads.common.lib.auth.OfflineCredentials.generateCredential(OfflineCredentials.java:240)
at jp.co.everrise.batch.util.AdwordsUtils.createOfflineCredentials(AdwordsUtils.java:56)
at jp.co.everrise.batch.service.GetReportAdwordsService.<init>(GetReportAdwordsService.java:48)
... 1 more
Caused by: com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request
{
  "error" : "invalid_grant",
  "error_description" : "Bad Request"
}
at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105)
at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287)
at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307)
at com.google.api.client.auth.oauth2.Credential.executeRefreshToken(Credential.java:570)
at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:362)
at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489)
at com.google.api.ads.common.lib.auth.OAuth2Helper.callRefreshToken(OAuth2Helper.java:69)
at com.google.api.ads.common.lib.auth.OfflineCredentials.generateCredential(OfflineCredentials.java:234)
... 3 more

Thank you very much. I hope to receive your response soon.
Du Doan.

Google Ads API Forum Advisor Prod

unread,
Jan 29, 2021, 3:30:15 PM1/29/21
to dudoa...@gmail.com, adwor...@googlegroups.com
Hi Du,

It looks like the client ID and secret that are in place were not used to generate the refresh token in the first instance. Please double check if you are using the right client credentials in your application.

Thanks,
Google Logo
Lakshmi Prathipati
Google Ads API Team
 


ref:_00D1U1174p._5004Q2BbycF:ref

dudoa...@gmail.com

unread,
Jan 31, 2021, 11:20:18 PM1/31/21
to AdWords API and Google Ads API Forum
Thank you for your response. I will check it again

My appreciation.
Du Doan

Google Ads API Forum Advisor Prod

unread,
Feb 1, 2021, 3:44:52 PM2/1/21
to dudoa...@gmail.com, adwor...@googlegroups.com
Hi Du,

Please let us know how it goes. Feel free to contact us if you have any further questions.
Reply all
Reply to author
Forward
0 new messages