Credential working on one machine but not on other!

43 views
Skip to first unread message

Koshish Rijal

unread,
Nov 16, 2019, 7:17:16 AM11/16/19
to AdWords API and Google Ads API Forum
HI! I am using Credential of clientId,Client secret, developer token and refresh token provided by my team! This credential is working fine in my device "windows" ! But as soon as i try to run it in another machine linux server! It throws exception as" Failed to create OAuth credentials. Check OAuth settings in the ads.properties file. Exception: com.google.api.ads.common.lib.exception.OAuthException: Credential could not be refreshed."!

Google Ads API Forum Advisor Prod

unread,
Nov 18, 2019, 2:40:01 PM11/18/19
to koshish...@gmail.com, adwor...@googlegroups.com

Hi Koshish,

Thank you for reaching out. This error generally occurs when the refresh token is invalid or expired. Could you please follow this guide to re-generate the refresh token and retry your request? If the error persists after re-generating your credentials, could you please share the complete request and response logs along with the client customer id and the email address used while generating the OAuth2 credentials for me to investigate further? Please use Reply privately to author option while sharing the details.

Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UOCJe0:ref

Koshish Rijal

unread,
Nov 20, 2019, 2:58:06 AM11/20/19
to AdWords API and Google Ads API Forum
Hi! Its strange! Its working in my local machine,We have 3 ubuntu servers Its not working on two but its not working in 3rd server which throws exception as  Exception: com.google.api.ads.common.lib.exception.OAuthException: Credential could not be refreshed.

Google Ads API Forum Advisor Prod

unread,
Nov 20, 2019, 10:53:38 AM11/20/19
to koshish...@gmail.com, adwor...@googlegroups.com

Hi Koshish,

Ideally, the same credentials should work on all the three servers provided everything else (user making the call, account etc.,) is same on all the server. Could you please verify your credentials using the below cURL request and see if you are able to generate the access token? If your credentials are correct, you should be able to generate an access token for the below CURL request.

curl https://www.googleapis.com/oauth2/v4/token \
-d refresh_token=your-refresh_token \
-d client_id=your-client-id \
-d client_secret=your-client-secret \
-d grant_type=refresh_token

If your credentials are incorrect or still facing issue then you could try generating a new refresh token with the help of this guide and retry your request. If not, could you please share the complete request and response logs along with the client customer id and email address authenticating the call for me to investigate this further on my end?

P.S: Please use Reply privately to author option while sharing the details.



Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UOCJe0:ref
Reply all
Reply to author
Forward
0 new messages