Hello, I would advise you to use OAuth 2.0 as the authorization mechanism which is also fully supported by the Python GData client library. This sample shows how to retrieve an OAuth 2.0 token:
http://code.google.com/p/gdata-python-client/source/browse/samples/apps/list_group_members.py#34 For your implementation, you will have to specify the Contacts API scope and simply use the gdata.contacts.client.ContactsClient class. Best, Alain On Tue, Feb 14, 2012 at 3:56 AM, durino13 <[email protected] > wrote: > Hello all. Can somebody please explain to me the authentication > differences when working with Google Apps? > > Goal: > > I need to write an application, which will manage my external contacts in > company. I am perfectly confused, what method to use. My application will > run on App engine .. What authentication shall I use then? Oauth2, Oauth?, > AuthSub? I want to use the benefits of 'gdata' python library .. > > While reading the docs, I found several authentication ways > > 1. > email = "domain" > password = "password" > self.gd_client = gdata.contacts.client.ContactsClient(source='appname') > self.gd_client.ClientLogin(email, password,self.gd_client.source) > feed = self.gd_client.GetContacts() > > 2. > contacts_client = gdata.contacts.client.ContactsService( > email = '[email protected]', > password = '********', > account_type = 'HOSTED', > contact_list = 'domain.com', > source = 'shared_contacts', > ) > contacts_client.ProgrammaticLogin() > contacts_manager = ContactsManager(contacts_client) > contacts_manager.DeleteAllContacts() > contacts_manager.ImportMsOutlookCsv(open('input.csv', 'rt'), > open('output.csv', 'wb')) > contacts_manager.ExportMsOutlookCsv(contacts_manager.GetAllContacts(), > open('outlook.csv', 'wb')) > > 3. > This source ( > http://code.google.com/googleapps/domain/shared_contacts/gdata_shared_contacts_api_reference.html) > says, I should go for AuthSub when working with 'shared contacts api' > > 4. > This document ( > http://code.google.com/apis/accounts/docs/GettingStarted.html) says I > should not use 'AuthSub' > > AuthSub and ClientLogin are Google's proprietary authorization APIs, > available as an alternative to OAuth for most Google APIs. If possible, you > should avoid using these services. If you already have applications that > use them, you should migrate to the recommended options described above. > > It looks like the aim is on oauth2 .. But I was not able to find an > example (using gdata library). > > Can you please explain to me the best practices and how shall I proceed? > > Can somebody give me a working example of python/oauth2/gdata/(prefferably > app engine) usage? > > -- > You received this message because you are subscribed to the Google > Groups "Google Contacts, Shared Contacts and User Profiles APIs" group. > To post to this group, send email to > [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://code.google.com/apis/contacts/community/forum.html > -- Alain Vongsouvanh | Developer Programs Engineer -- You received this message because you are subscribed to the Google Groups "Google Contacts, Shared Contacts and User Profiles APIs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://code.google.com/apis/contacts/community/forum.html
