Hi everybody...

I'm using OAuth for .Net and it's driving me mad. I want to access
shared contacts from domain2, with a consumer key & secret for
domain1. Domain2 is configured for domain1 to access.

I want to access contacts using GoAuthRequestFactory, ContactsService
and ContactQuery classes, but with no luck: application fails
miserably when executes the query (401: unauthorized).

Some considerations:
- No firewall issue.
- No time zone issue (computer clock always set at UTC time).
- Re-checked access to domain2 from domain1.
- If I set user and password, it works perfectly. But it's 3-legged,
and I have to use 2-legged.
- Tried the sample OAuth.Net.Examples.OAuthRequest and fails the same.
- Google.GData Client & Contacts api v. 1.4.0.2
- This is a console application (main method).
- I need to retrieve shared contacts from domain2.
- I currently have access to both domain1 and domain2, but in
production environment I won't.


It's pretty frustrating, I've spent the whole day and it didn't
work... I really can't figure what's going on.

            try
            {

                // Create an OAuth factory to use
                GOAuthRequestFactory requestFactory = new
GOAuthRequestFactory("cp", "yourCompany-YourAppName-v1");
                requestFactory.ConsumerKey = "domain1";
                requestFactory.ConsumerSecret =
"consumersecret";

                ContactsService cs = new ContactsService("yourCompany-
YourAppName-v1");
                cs.RequestFactory = requestFactory;

                String user = "admin@domain2";

                ContactsQuery cq = new ContactsQuery();
                cq.Uri = new OAuthUri("https://www.google.com/m8/feeds/
contacts/domain2/full", user, requestFactory.ConsumerKey);

                //This is the line that ALWAYS fails
                ContactsFeed cf = cs.Query(cq);

                foreach (ContactEntry ce in cf.Entries)
                    Console.WriteLine(ce.EditUri);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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://groups.google.com/group/google-appengine?hl=en.

Reply via email to