3-legged-oauth and Google ContactsClient problem

Posted by PanosJee on Stack Overflow See other posts from Stack Overflow or by PanosJee
Published on 2010-03-13T18:17:25Z Indexed on 2010/03/13 18:25 UTC
Read the original article Hit count: 252

Filed under:
|
|

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)

© Stack Overflow or respective owner

Related posts about oauth

Related posts about google-contacts