Closed GoogleCodeExporter closed 9 years ago
Here is the code:
Google.Apis.Services.BaseClientService.Initializer ds = new
Google.Apis.Services.BaseClientService.Initializer();
ds.ApiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
string scope_url = "https://www.googleapis.com/auth/" + "devstorage.readonly";
string client_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com";
string key_file = @"xxxxxxxxxxxxxxxxxxxxxxxxxxx-privatekey.p12";
string key_pass = "notasecret";
AuthorizationServerDescription desc = GoogleAuthenticationServer.Description;
//key: Load up and decrypt the key
X509Certificate2 key = new X509Certificate2(key_file, key_pass, X509KeyStorageFlags.Exportable);
//client: we're using the AssertionFlowClient, because we're logging in with our certificate
AssertionFlowClient client = new AssertionFlowClient(desc, key) { ServiceAccountId = client_id, Scope = scope_url };
OAuth2Authenticator<AssertionFlowClient> auth = new OAuth2Authenticator<AssertionFlowClient>(client, AssertionFlowClient.GetState);
ds.Authenticator = auth;
AndroidPublisherService service = new AndroidPublisherService(ds);
PurchasesResource.GetRequest ret = service.Purchases.Get("com.xxxxxx.ui", "xxxxxxxxxx.xxxxxxxxx", "34wfdsf3cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
var rt = ret.Execute();
Original comment by sams...@gmail.com
on 12 Aug 2013 at 1:10
Original comment by pele...@google.com
on 27 Sep 2013 at 10:02
Please use our new OAuth2 library.
More information is available in our OAuth2 wiki page
https://code.google.com/p/google-api-dotnet-client/wiki/OAuth2
I'm closing this issue, let me know you encounter a new problem with the new
OAuth2 library.
Original comment by pele...@google.com
on 28 Nov 2013 at 5:59
HI Team,
Please send me the link for new OAuth2 library .
Original comment by prashant...@gmail.com
on 11 Sep 2014 at 8:57
HI Team,
I am use Google.Api Dll
Version : 1.6.0.16897
when i am feching Circle Data for
scope: https://www.googleapis.com/auth/plus.login
ERROR : Error occurred while sending a direct message or getting the response.
Original comment by prashant...@gmail.com
on 11 Sep 2014 at 11:41
I think you should use our latest Plus library - Downoad it from NuGet -
https://www.nuget.org/packages/Google.Apis.Plus.v1/
Original comment by pele...@google.com
on 11 Sep 2014 at 1:27
Original issue reported on code.google.com by
sams...@gmail.com
on 12 Aug 2013 at 1:04