Failed to refresh access token: invalid_client

2,281 views
Skip to first unread message

yadyga...@gmail.com

unread,
Dec 28, 2015, 8:58:44 AM12/28/15
to AdWords API Forum
I am using Adwords API .NET library, MCC account is linked with company's account, developer token has basic access. 
The OAuth client worked correctly for 14-15 days till this Monday morning (28.12.2015), and now I'm getting next error:
Failed to refresh access token.
{
  "error" : "invalid_client",
  "error_description" : "The OAuth client was not found."
}
I've changed OAuth credentials, generated new refresh token, but still getting this error. 

Umesh Dengale

unread,
Dec 28, 2015, 5:29:09 PM12/28/15
to AdWords API Forum
Hello,

Could you verify that you followed all steps given in the OAuth2.0 guide for .NET library?  Please recreate the client id and client secret and generate refresh token using new client id and client secret key and update the web.config file. Please check out the OAuth2.0 guide for .NET library for more details. If still issue is not resolved then provide the steps you followed and error message.

Thanks,
Umesh, AdWords API Team.

vib...@whisskers.com

unread,
Nov 21, 2018, 1:25:55 AM11/21/18
to AdWords API and Google Ads API Forum
I am also facing the same issue, i am using Dot client library and trying get campaign using the console application. This code is working fine with my test account then i have got approval for basic access of my developer token to access production account campaign data

generated following and replaced in my app.config

OAuth2ClientId
OAuth2ClientSecret
OAuth2RefreshToken

issue: when trying to get campaign then getting error given below

Message :Failed to refresh access token
innerexception : Error:"invalid_client", Description:"Unauthorized", Uri:""
stacktrash: 

Server stack trace: 
   at Google.Api.Ads.Common.OAuth.AdsOAuthProviderImpl.RefreshAccessTokenInOfflineMode()
   at Google.Api.Ads.Common.OAuth.AdsOAuthProviderImpl.RefreshAccessToken()
   at Google.Api.Ads.Common.OAuth.AdsOAuthProviderImpl.GetAuthHeader()
   at Google.Api.Ads.Common.OAuth.OAuthClientMessageInspector.BeforeSendRequest(Message& request, IClientChannel channel)
   at System.ServiceModel.Dispatcher.ImmutableClientRuntime.BeforeSendRequest(ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.PrepareCall(ProxyOperationRuntime operation, Boolean oneway, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Google.Api.Ads.AdWords.v201806.CampaignServiceInterface.get(Selector serviceSelector)
   at Google.Api.Ads.AdWords.v201806.CampaignService.get(Selector serviceSelector) in G:\AD Word Manager\googleads-dotnet-lib-master\googleads-dotnet-lib-master\src\AdWords\v201806\AdWordsApi.cs:line 39105
   at Google.Api.Ads.AdWords.Examples.CSharp.v201806.GetCampaigns.Run(AdWordsUser user) in G:\AD Word Manager\googleads-dotnet-lib-master\googleads-dotnet-lib-master\GetCampaign\Program.cs:line 93



Failed to refresh access token.png

Thanks in advance
Failed to refresh access token.png

Luis Xander Talag (AdWords API Team)

unread,
Nov 21, 2018, 3:07:59 AM11/21/18
to adwor...@googlegroups.com
Hi,

Could you confirm if you are using the latest .Net client library? Could you try to generate again an OAuth2 credentials by following this guide? Then, try making request again. If the issue persist, could you provide the complete logs so I could further investigate? 

Also, I would suggest to use Google Chrome using incognito mode to make sure that you are using the same email address in the whole process of generating OAuth2 credentials.

Thanks and regards,
Luis
AdWords API Team

vib...@whisskers.com

unread,
Nov 29, 2018, 1:51:12 AM11/29/18
to AdWords API and Google Ads API Forum
Thanks Luis, I did it carefully as you suggested and solution works for me

Yes, i am using .Net Client library 
Reply all
Reply to author
Forward
0 new messages