This is a correction to my original post:

I have been trying for days to get integrated with Google contact but I am 
stuck with this *"401 Token invalid - Invalid AuthSub token"*. When I enter 
the same paramaters in http://googlecodesamples.com/oauth_playground/ and 
TwoLeggedOAuthExample, 
I get the same error response. It works when I perform 3 legged oauth. But I 
want to use 2 legged oauth.

Below is my code summary and response:

*Code*:
URL feedUrl = new URL("
https://www.google.com/m8/feeds/contacts/default/[email protected]
");

ContactQuery query = new ContactQuery(feedUrl);
ContactsService contactsService = new ContactsService("myapp");
GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();
oauthParameters.setOAuthConsumerKey(PropertyHelper.getProperty(DataConstant.GOOGLE_CONSUMER_KEY));
oauthParameters.setOAuthConsumerSecret(PropertyHelper.getProperty(DataConstant.GOOGLE_CONSUMER_SECET));
contactsService.setOAuthCredentials(oauthParameters, new 
OAuthHmacSha1Signer());
ContactFeed results = contactsService.getFeed(query, ContactFeed.class);


*Error:*
HTTP/1.1 401 Token invalid - Invalid AuthSub token

-- 
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

Reply via email to