google-api-dotnet-client

Is it possible to use json key instead of p12 key for service account credentials?

折月煮酒 提交于 2019-11-27 22:45:17
I am using "Google.Apis.Bigquery.v2 Client Library" with C#. I am authorizing to Google BigQuery using "Service Account" (see http://www.afterlogic.com/mailbee-net/docs/OAuth2GoogleServiceAccounts.html ). To create the X509 certificate I use the p12 key from the Google Developers Console. However, right now the json key is the default. Can I use it instead the p12 key? I have the following code: string serviceAccountEmail = "xxxx@developer.gserviceaccount.com"; X509Certificate2 certificate; using (Stream stream = new FileStream(@"C:\key.p12", FileMode.Open, FileAccess.Read, FileShare.Read)) {

.NET Google api 1.7 beta authenticating with refresh token

情到浓时终转凉″ 提交于 2019-11-27 21:36:31
I've been looking at the Oauth .Net Google Apis in order to authenticate via OAuth and use the Google drive Apis. Specifically, I want to use a refresh token I already have stored in order to use it to instantiate a GoogleDrive service. I've found samples like https://code.google.com/p/google-api-dotnet-client/source/browse/Tasks.SimpleOAuth2/Program.cs?repo=samples That seem to use "GoogleWebAuthorizationBroker.AuthorizeAsync" but I'm not sure how I can use that method with a refresh token rather than the client secrets you seem to be feeding it in this example. If I understand you correctly,

Google API OAuth2, Service Account, “error” : “invalid_grant”

本秂侑毒 提交于 2019-11-27 16:02:17
I'm trying to use service account to sync calendars from Dynamics CRM software to Google. During this I faced lack of documentation on google API for .net, especially regarding authorization. Most of Google samples can't be even compiled because of outdated libraries and classes used. So I found some example over interned and receive error. Could someone please look on my sample and tell what am I doing wrong? Preparatory steps: I created a project in my private Google account. In project developer console, under APIS & AUTH -> Credentials, I generated Service Account. Then clicked on

Google Admin SDK Unable to Create User - Exception 403 Forbidden

冷暖自知 提交于 2019-11-27 08:25:10
问题 I am trying to create a user using C# and the google-admin-directory_v1-rev24-csharp-1.7.0-beta client libraries however I keep geting an exception: Google.GoogleApiException was unhandled HResult=-2146233088 Message=Google.Apis.Requests.RequestError Not Authorized to access this resource/api [403] Errors [ Message[Not Authorized to access this resource/api] Location[ - ] Reason[forbidden] Domain[global] ] Source=Google.Apis ServiceName=admin StackTrace: at Google.Apis.Requests

Google API Calender v3 Event Insert via Service Account using Asp.Net MVC

限于喜欢 提交于 2019-11-27 04:54:16
问题 I have been trying to insert a Google calendar event via Google service account that was created for an app in my dev console, but I am continually getting a helpless 404 response back on the Execute method. In the overview of the dev console I can see that the app is getting requests because there are instances of errors on the calendar.events.insert method. There is no information on what is failing. I need this process to use the Service account process instead of OAuth2 so as to not

GoogleWebAuthorizationBroker.AuthorizeAsync Hangs

╄→尐↘猪︶ㄣ 提交于 2019-11-27 04:51:46
Our website needs to upload videos to youtube from the code behind (asp.net mvc application). I'm trying to get the google credentials, but when i call the AuthorizeAsync, the application just hangs. I've looked all over for a solution and none seem to help out. I've already searched for the obvious on google and stack overflow. most of what i found mentioned that the application might not have access the the appdata folder, so i tried changing the folder to be in the c drive, d drive and in the actual inetpub location. i tested and found i was able to have the application write to those

Is it possible to use json key instead of p12 key for service account credentials?

陌路散爱 提交于 2019-11-27 04:35:55
问题 I am using "Google.Apis.Bigquery.v2 Client Library" with C#. I am authorizing to Google BigQuery using "Service Account" (see http://www.afterlogic.com/mailbee-net/docs/OAuth2GoogleServiceAccounts.html). To create the X509 certificate I use the p12 key from the Google Developers Console. However, right now the json key is the default. Can I use it instead the p12 key? I have the following code: string serviceAccountEmail = "xxxx@developer.gserviceaccount.com"; X509Certificate2 certificate;

Google Analytics OAuth with AccessType = Offline in C#

纵饮孤独 提交于 2019-11-27 02:27:44
问题 I want to use Google Analytics API using OAuth. I am using this library: http://code.google.com/p/google-api-dotnet-client/ The following code is used for authentication: var credential = GoogleWebAuthorizationBroker.AuthorizeAsync( new ClientSecrets { ClientId = "...", ClientSecret = "..." }, new[] {Google.Apis.Analytics.v3.AnalyticsService.Scope.AnalyticsReadonly}, "user", CancellationToken.None, new FileDataStore("Analytics.Auth.Store")).Result; var service = new Google.Apis.Analytics.v3

Google OAuth access token expiration in MVC app?

无人久伴 提交于 2019-11-27 02:24:37
问题 I wrote an MVC app using Google Oauth2 as instructed here: https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#web_applications I have an issue with access token expiration. When access token expires, I get the exception when calling Google API: "The access token has expired but we can't refresh it" The initial authentication is two iterations mechanism: first iteration AuthorizeAsync returns result with empty Credential, and populated RedirectUri: So, the authorization

ASP.net app crashes - Could not load file or assembly 'Microsoft.Threading.Tasks.Extensions.Desktop'

喜夏-厌秋 提交于 2019-11-27 01:51:09
问题 I want to build a Google BigQuery C# ASP.net application using OAuth2 and the .Net 4.5 framework. I ran these NuGet installs Install-Package Google.Apis.Bigquery.v2 -Pre Install-Package Google.Apis.Authentication.OAuth2 -Version 1.2.4696.27634 Install-Package Google.Apis -Pre Install-Package Google.Apis.Auth -Pre and I placed the relevant "usings" in code-behind file "default.aspx.cs": using System; using System.Collections.Generic; using System.IO; using System.Threading; using System.Web;