Martialdelastic / google-api-adwords-php

Automatically exported from code.google.com/p/google-api-adwords-php
Apache License 2.0
0 stars 0 forks source link

Allow auth token reuse #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What is the feature you would like to see added to the library?
Caching of the auth token for a specified period of time, so not every API
call requires an authentication call.

When would this feature be useful?
I experienced a lot of login failures, where the Google Client
Authentication service told me that my credentials are not valid. It seems
to happen a lot when making many calls to the API.

Would you be willing to implement this feature and contribute it to the
project?
I attached the necessary changes I made for our project. It saves the
response serialized in a file, and only refreshs it if the file is older
than 1 day.

Original issue reported on code.google.com by ckr...@klicktel.de on 9 Apr 2010 at 1:46

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the feature request and the example code.  Rather than automatically 
cache 
the authTokens it may make more sense to change the AdWordsUser class to accept 
an 
existing authToken while it's being constructed.  This would allow each 
application to 
cache the authToken in a way that works for their environment (memory, file, 
session, 
etc) and still be able to feed it into the AdWordsUser.

Original comment by api.ekol...@gmail.com on 9 Apr 2010 at 4:14

GoogleCodeExporter commented 8 years ago
I agree, and my solution is merely a temporary one till there is a more final
solution in the framework itself. Otherwise problems like mentioned in the 
Google
Group
(http://groups.google.com/group/adwords-api/browse_thread/thread/e5bb8dbc3dfb38a
5/a7cf15b2ca4c5d1b#a7cf15b2ca4c5d1b)
appear a lot, e.g. when trying to migrate LBA's to textads with location 
extensions.

Original comment by ckrahn1...@gmail.com on 13 Apr 2010 at 12:34

GoogleCodeExporter commented 8 years ago
Version 2.3.0 allows you to pass the authToken in the constructor or call 
SetAuthToken() after it's constructed.  An authToken is not requested from the 
ClientLogin service until the first AdWords API service client is generated, so 
both methods prevent extra authTokens from being requested.

Original comment by api.ekol...@gmail.com on 15 Sep 2010 at 9:11

GoogleCodeExporter commented 8 years ago
Fixed in r88.

Original comment by api.ekol...@gmail.com on 15 Sep 2010 at 9:18