karishmal / google-api-dotnet-client

Automatically exported from code.google.com/p/google-api-dotnet-client
Apache License 2.0
0 stars 0 forks source link

2-legged oauth request #170

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
API : Any (preferrably Analytics Management API 3.0)

What to do : Using two-legged oauth, perform any request to any API 
(preferrably Account List of Analytics Management API 3.0)

Platform : Windows (VS 2010)

Details : This is quite simple, I only want to get started using 2-legged 
oauth. Something like this is what I expect (it doesn't work, I get "wrong 
credentials") : 

<csharp>

var auth = new 
Google.Apis.Authentication.OAuth2LeggedAuthenticator(DOMAIN_CONSUMER_KEY, 
DOMAIN_CONSUMER_SECRET, USER_TO_IMPERSONATE, DOMAIN);

            Google.Apis.Analytics.v3.AnalyticsService service = new Google.Apis.Analytics.v3.AnalyticsService(auth);

            service.Key = DEV_KEY_FROM_API_CONSOLE;

            var _request = service.Management.Accounts.List();

            foreach (var item in _request.Fetch().Items)
            {
                Console.WriteLine(item.Name);
            }

</csharp>

Original issue reported on code.google.com by billy.br...@lanec.com on 3 Nov 2011 at 7:35

GoogleCodeExporter commented 9 years ago
If this isn't clear, this is a SAMPLE REQUEST... I wasn't sure how this worked.

Original comment by billy.br...@lanec.com on 3 Nov 2011 at 7:37

GoogleCodeExporter commented 9 years ago
Unfortunately 2-legged oauth is a feature of OAuth 1.0 and not supported in 
OAuth 2.0. A new replacement feature is in development (Service Accounts) 
please see the documentation here:

[OAuth 1.0 is deprecated]
https://developers.google.com/accounts/docs/OAuth

[Information on OAuth 2.0 Service accounts]
https://developers.google.com/accounts/docs/OAuth2ServiceAccount

Original comment by asky...@google.com on 25 Apr 2012 at 5:33

GoogleCodeExporter commented 9 years ago
Thanks

Original comment by billy.br...@lanec.com on 27 Apr 2012 at 12:30