3-legged-oauth and Google ContactsClient problem
- by PanosJee
Hi I am using 3-legged-oauth to import a users' Google contacts in my app.
I did not find the ContactsClient library but i was using only the ContacsService and i was fetching the ContactsFeed but that resulted to not having a lot of data.
After the user allows my apps i store the auth_token key and secret so i can run a cron task to fetch contacts' updates
I am using this code atm:
google = gdata.contacts.service.ContactsService(source=GOOGLE_OAUTH_SETTINGS['APP_NAME'])
google.SetOAuthInputParameters(GOOGLE_OAUTH_SETTINGS['SIG_METHOD'],
GOOGLE_OAUTH_SETTINGS['CONSUMER_KEY'],
consumer_secret=GOOGLE_OAUTH_SETTINGS['CONSUMER_SECRET'])
access_token = gdata.auth.OAuthToken(user_oauth_token, user_oauth_secret)
access_token.oauth_input_params = google.GetOAuthInputParameters()
google.SetOAuthToken(access_token)
feed = google.GetContactsFeed()
When i try to use the contacts client
contacts_client = gdata.contacts.client.ContactsClient(
source=GOOGLE_OAUTH_SETTINGS['APP_NAME'])
feed2 = contacts_client.GetContacts(auth_token = access_token)
I get the following error (please note that the access_token is the same as above and I user 3-legged-oauth HMAC)
Actual results:
File "/Library/Python/2.5/site-packages/atom/client.py", line 108, in request
auth_token.modify_request(http_request)