You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'OAuth realm="https://accounts.google.com/OAuthGetRequestToken"'.
#232
Open
Swapygit opened this issue
Sep 15, 2020
· 3 comments
I am trying to link to google adwords account using Oauth2 in C# .net . However, I am getting the following error,
MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'OAuth realm="https://accounts.google.com/OAuthGetRequestToken"'. [Returned while handling POST Request]
I had a communication regarding this with the Google Adwords support team. They had following reply for this
It looks like the issue is specific to the client library that you're using. Could you please post your concern on the Github issue tracker so the library owners can assist you on this
Kindly suggest what can I do to resolve the exception
Please find the below details regarding the issue which will help you to find the root cause.
We are not using WCF service.We are not using Google Ads Api. We are using Google Adwords API v201809.
Please find below the steps we are following.
We are using ASP.NET MVC Web API. We have a mobile app where user clicks on Connect to google adwords. When the user clicks the button he is redirected to google sign in page and after sign in it is re directed to the back end MVC web API along with the server token. We use this server token and fetch the customer using the service.getCustomers() method of the Google AdWordsService.v201809.CustomerService.
Please find the below code we have used
Customer c = new Customer();
Selector selector = new Selector()
{
fields = new string[] { Convert.ToString(c.customerId), c.descriptiveName }
};
CustomerService service =
(CustomerService)user.GetService(AdWordsService.v201809.CustomerService);
Customer[] cst = service.getCustomers();
And according to our error logs we are getting the error on the line
Customer[] cst = service.getCustomers();
Also, this error does not occur for all the users. Suppose, out of 100 we are get this error 1 or 2 customer.
If the error was due to code, then it should have occurred for all the users. But that's not the case.
Looking forward for your response.
Thanks.
Swapnil
The text was updated successfully, but these errors were encountered:
obj.idToken // idToken that can be exchanged to verify user identity.
obj.serverAuthCode // Auth code that can be exchanged for an access token and refresh token for offline access
obj.accessToken // OAuth2 access token
Using obj.serverAuthCode we start account linking process.
To start account linking we are we are using serverAuthCode to generate access token and refresh token for offline access
For this we are using FetchAccessAndRefreshTokens(apireq.servertoken) method from google adwords api v201809 (.net library)
Now for all users its working properly , but for some we are getting error in
Below is the stack trace and URL which caused this error.
Message: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'OAuth realm="https://accounts.google.com/OAuthGetRequestToken"'.
Hi Team,
I am trying to link to google adwords account using Oauth2 in C# .net . However, I am getting the following error,
MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'OAuth realm="https://accounts.google.com/OAuthGetRequestToken"'. [Returned while handling POST Request]
I had a communication regarding this with the Google Adwords support team. They had following reply for this
It looks like the issue is specific to the client library that you're using. Could you please post your concern on the Github issue tracker so the library owners can assist you on this
Kindly suggest what can I do to resolve the exception
Please find the below details regarding the issue which will help you to find the root cause.
We are not using WCF service.We are not using Google Ads Api. We are using Google Adwords API v201809.
Please find below the steps we are following.
We are using ASP.NET MVC Web API. We have a mobile app where user clicks on Connect to google adwords. When the user clicks the button he is redirected to google sign in page and after sign in it is re directed to the back end MVC web API along with the server token. We use this server token and fetch the customer using the service.getCustomers() method of the Google AdWordsService.v201809.CustomerService.
Please find the below code we have used
Customer c = new Customer();
And according to our error logs we are getting the error on the line
Customer[] cst = service.getCustomers();
Also, this error does not occur for all the users. Suppose, out of 100 we are get this error 1 or 2 customer.
If the error was due to code, then it should have occurred for all the users. But that's not the case.
Looking forward for your response.
Thanks.
Swapnil
The text was updated successfully, but these errors were encountered: