|
||||||
This message was sent to the following 2 people: Werner Reyneke, Google Ads API Forum Advisor. Replying to this email will notify them.
Google Ads API Forum Advisor was added to the conversation by adwor...@googlegroups.com
Hi Werner,
Thanks for reaching out. Can you please privately provide us with the complete request and response logs for this error?
Thanks,
Matt
Google Ads API Team
https://www.gstatic.com/images/branding/product/1x/googleg_64dp.png Matt Google Ads API Team https://google-dev-relations.my.salesforce.com/servlet/servlet.ImageServer?oid=00D1U000001174p&esid=0184Q00001FioQL&from=ext
ref:_00D1U1174p._5004Q2W5q00:ref --
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/N7gSG000000000000000000000000000000000000000000000R73FJP00tEbeEYw_TDa35KXZ7t_6MA%40sfdc.net. On Wed, Feb 9, 2022 at 02:21 PM, "Werner Reyneke" <wrey...@gmail.com> wrote:
I get this error after having authenticated from within a .Net desktop application:
Google.Ads.GoogleAds.V9.Errors.GoogleAdsException
HResult=0x80131500
Message=Status(StatusCode="Unauthenticated", Detail="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."
What is the correct code to use to authenticate please?
This is what I currently use:
GoogleAdsConfig config = new GoogleAdsConfig()
{
DeveloperToken = "******",
OAuth2Mode = OAuth2Flow.APPLICATION,
OAuth2ClientId = "77834483876-1kgp7ggidhacug709g3cb3.apps.googleusercontent.com",
OAuth2ClientSecret = "GOCSPX-PNxVv90i-niUB1YBJs1FUOCL",
OAuth2RefreshToken = "******"
};
//GoogleAdsConfig config = new GoogleAdsConfig();
// Load the JSON secrets.
ClientSecrets secrets = new ClientSecrets()
{
ClientId = config.OAuth2ClientId,
ClientSecret = config.OAuth2ClientSecret
};
// Authorize the user using desktop application flow.
Task<UserCredential> task = GoogleWebAuthorizationBroker.AuthorizeAsync(
secrets,
new string[] { GOOGLE_ADS_API_SCOPE },
String.Empty,
CancellationToken.None,
new NullDataStore()
);
UserCredential credential = task.Result;
// Store this token for future use.
string refreshToken = credential.Token.RefreshToken;
// To make a call, set the refreshtoken to the config, and
// create the GoogleAdsClient.
config.OAuth2RefreshToken = refreshToken;
GoogleAdsClient client = new GoogleAdsClient(config);
// Create the required service.
GoogleAdsServiceClient googleAdsService = client.GetService(
Services.V9.GoogleAdsService);--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/481bb481-9d3f-4512-b5de-ec035d4f6d2dn%40googlegroups.com.
![]()
![]()
Hi Werner,
Since you are using a .Net client library, you may enable logging on your end by following this guide. Logging will generate complete request and response logs with the request-id which will help our team to investigate the issue further. Kindly provide us those logs via Reply to author privately option.
Regards,
|
||||||
Hi Werner,
In addition, I had to delete your first post since it included sensitive details since posting sensitive details on forum thread is not recommended.
Regards,