Google Groups

Re: Any server configuration required to run OAuth 1.0a - getting OAUTH_TOKEN_HEADER_INVALID error on server where as running successfully on local setup and one server.


Chirag Jul 7, 2012 12:38 AM
Posted in group: AdWords API Forum
Hi Eric,

Yes, i am successfully able to use Report Download Request from command line on both server.
When i set date_default_timezone_set('Asia/Calcutta'); That PHP warning also gone.

Please look at final result:

OAuth authorization successful.
Report with name 'Criteria performance report #4ff7dd422ea1a' was downloaded to '/var/www/html/cron/report_command_line.csv'.

Thanks,
Chirag


On Wednesday, June 13, 2012 12:15:31 AM UTC+5:30, Eric Koleda wrote:
Hi Chirag,

I would encourage you to set the timezone on that server in the php.ini file, to ensure the timestamps are accurate. Can you try replacing the CampaignService.get() call in the UseOAuth.php example with a report download request, and then run that on both servers?

Best,
- Eric

On Tue, Jun 12, 2012 at 3:51 AM, Chirag <chirag....@gmail.com> wrote:
Hello Eric,
Sorry for late reply.

Finally i got access from server to run command line example "UseOAuth.php".
Yes on both server it works fine, but on server where adhoc report is not working there i got php warning for date.

PHP Warning:  date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Calcutta' for 'IST/5.0/no DST' instead in /var/www/html/src/Google/Api/Ads/Common/Util/Logger.php on line 234

Thanks,
chirag


On Monday, June 4, 2012 11:27:57 PM UTC+5:30, Eric Koleda wrote:
Hi Chirag,

Certainly a tricky problem. As a baseline, can you try running the command line example "UseOAuth.php" on both servers, to see if that works?

- Eric

On Mon, Jun 4, 2012 at 12:28 PM, Chirag <chirag....@gmail.com> wrote:
Hi Eric,

Are these new OAuth tokens or are you using the same token on both servers?
I am using same Oauth tokens for both servers.

Can you double check that you are using the same consumer key and secret on both servers?
Yes, I am using same consumer key and secret.

Thanks,
chirag

On Monday, June 4, 2012 7:11:25 PM UTC+5:30, Eric Koleda wrote:
Hi Chirag,

I didn't see any problems or noticeable differences with the broken request. Are these new OAuth tokens or are you using the same token on both servers? Can you double check that you are using the same consumer key and secret on both servers?

- Eric

On Mon, Jun 4, 2012 at 7:23 AM, Chirag <chirag....@gmail.com> wrote:
Hi Eric,

Sorry for late reply.
Please find both server's response.

Thanks,
chirag


On Friday, June 1, 2012 11:56:15 PM UTC+5:30, Eric Koleda wrote:
My apologies again, I was parsing it as milliseconds and not seconds. That does appear to be correct.

Regarding my other point, it would be helpful to compare the Authorization header from the server that is working with the one from the server that is not working. Can you post the sanitized version of both?

- Eric

On Fri, Jun 1, 2012 at 1:33 PM, Chirag <chirag....@gmail.com> wrote:
Hello Eric,

I think timestamp is correct.

oauth_timestamp="1338338512" is refers to the Wed, 30 May 2012 00:41:52 GMT

What are the timestamps like for working requests?
I am not getting this. I am working with timezone 'Asia/Calcutta'.

Thanks,
Chirag


On Friday, June 1, 2012 10:19:58 PM UTC+5:30, Eric Koleda wrote:
Hi Chirag,

My apologies, I forgot this was for report downloads, so you should only get a log with the report request. For report requests the OAuth parameters are passed in the Authorization header.  The value of the timestamp used seems to be wrong:

oauth_timestamp="1338338512"

This corresponds to Fri Jan 16 1970 06:45:38 GMT-0500 (EST), which is not correct.  What are the timestamps like for working requests?

Best,
- Eric

On Fri, Jun 1, 2012 at 12:32 PM, Chirag <chirag....@gmail.com> wrote:
Hello Eric,

Thanks for reply.
Yes i will look into date and time suggestion you mentioned.
But,for logging, I have $user->LogAll(); is set.
but i am not getting any log. I just got logs for reporting and it is attached.

Thanks,
chirag



On Friday, June 1, 2012 9:37:09 PM UTC+5:30, Eric Koleda wrote:
Hi Chirag,

It's strange that the error is only appearing on specific server environments. The next step in debugging this issue would be to take a look at the URL the SOAP request is being made to, since the PHP client library appends the OAuth parameters to the URL.  If you enable SOAP XML logging the URL is recorded in the logs.  Perhaps a visual inspection of the URL will show a difference between the environments.

One possible cause to investigate is whether the date and time is configured correctly on the server. When signing the OAuth parameters the current date/time is used, and if this is incorrect the AdWords API server may reject the request.

Best,
- Eric Koleda, AdWords API Team

On Friday, June 1, 2012 2:32:08 AM UTC-4, Chirag wrote:
Hello Danial,
Any update i am waiting for your reply otherwise i need to change server configuration from centOS to Ubuntu one.
Please note that i am using PHP client library.

Thanks,
chirag

On Monday, May 28, 2012 9:02:43 PM UTC+5:30, Danial Klimkin wrote:
Hello Chirag,


Are you using any of our client libraries?


-Danial, AdWords API Team.


On Thursday, May 24, 2012 4:52:20 PM UTC+4, Chirag wrote:
Hello All,

Any special configuration required for Running OAuth 1.0a running succesfully?
I am trying to run one of my report download code, but it is giving error :

Error Message: <eye3-stackless title='AuthServer User Error OAUTH_TOKEN_HEADER_INVALID'/> AuthenticationError.OAUTH_TOKEN_HEADER_INVALID @ ; trigger:'<null>'; errorDetails:message=Invalid Header Service[ReportInfoService.get]

Please note : It is only has error from few server only. This same file is working on my localhost setup and also from two of my server.

--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords 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

--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords 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

--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords 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

--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords 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

--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords 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