google-api-dotnet-client

Universal Windows Platform App with google calendar

我是研究僧i 提交于 2019-12-24 04:09:16
问题 Hey im trying to make an Universal Windows Platform App where google calendar is in it, but i cant figure out how to convert the code, i got the code to work on a WPF App. I am not the best at coding https://developers.google.com/google-apps/calendar/quickstart/dotnet this is the site i use as a guideline in the start if its to any help, any help? Code below: using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading; using

YouTube C# API V3, how do you delete a partially uploaded video without the ID?

孤者浪人 提交于 2019-12-24 03:46:29
问题 The VideoID is returned in the ResponseReceived event but not before the upload has completed. If the user cancels and deletes the upload, how do you delete it from the YouTube servers? What I'm currently doing is an ugly but working hack. I set the title to a unique guid. When the upload completes, I set the correct title. If the upload is deleted, I get the first channel and search the playlist for the guid title. This returns the VideoID and I can delete the video. There has to be a better

How to resolve 'The access token has expired but we can't refresh it' in MVC

╄→尐↘猪︶ㄣ 提交于 2019-12-24 00:57:32
问题 I'm currently working on Google Api which aims to get the circles of a loggedin person.I already have the access token but the problem is whenever I try to run my code it returns this exception The access token has expired but we can't refresh it How do I resolve this issue? var claimsforUser = await UserManager.GetClaimsAsync(User.Identity.GetUserId()); var access_token = claimsforUser.FirstOrDefault(x => x.Type == "urn:google:accesstoken").Value; string[] scopes = new string[] {PlusService

Change Google default Auth Redirection - C# (Google liblary)

不羁岁月 提交于 2019-12-23 21:26:59
问题 I try this code: https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#web_applications my code same But! I need change this default url redirection. Now is: redirect_uri=http:%2F%2Flocalhost:52674%2FAuthCallback%2FIndexAsync How I can change this url? Guys please help. Thank you 回答1: You can inherit form FlowMetadata and override the AuthCallback property. Take a look in the following link: https://code.google.com/p/google-api-dotnet-client/source/browse/Src/GoogleApis.Auth

Moving files with Google Drive API v3

北战南征 提交于 2019-12-23 12:39:38
问题 Im trying to move a file from one folder to another using the Google Drive API v3. I found documentation how to this here. I used the .NET sample code from the documentation page and created a method that looks like this: public ActionResult MoveFile(string fileToMove, string destination) { DriveService service = new DriveService(new BaseClientService.Initializer { HttpClientInitializer = <USER CREDENTIAL>, ApplicationName = "APPNAME" }); var searchFiles = service.Files.List(); searchFiles

Using the Google API .NET client with an existing access token

限于喜欢 提交于 2019-12-23 08:54:04
问题 The use-case is the following: a mobile app is authenticating a user with Google and at some point, we need to publish a user's video to his YouTube account; for practical reasons, the actual publication should be done by the back-end (large files that are already stored there). As the user is already authenticated by the app, the app just sends the user's access token to the back-end. Now my struggle is to find how to use this access token with the .NET client... So far I've tried to create

Google Admin Directory API: Add User Employee Details

拟墨画扇 提交于 2019-12-23 02:42:09
问题 I already have a working function for adding user using Google Admin Directory: string password = Random_Password(); User newuserbody = new User(); UserName newusername = new UserName(); UserOrganization newuserorg = new UserOrganization(); newusername.GivenName = GivenName; newusername.FamilyName = FamilyName; newuserbody.Name = newusername; newuserorg.Department = Department; newuserorg.CostCenter = Country; newuserorg.Title = JobTitle; newuserbody.Organizations = newuserorg; newuserbody

“policy_enforced” error when exchange oauth2 token for google plus

拈花ヽ惹草 提交于 2019-12-22 10:07:55
问题 Our app used to work fine until last Tue. We kept getting "policy_enforced" error while exchange oauth2 token for google plus. The response from google is: Google.Apis.Auth.OAuth2.Responses.TokenResponseException: Error:"policy_enforced", Description:"Access denied by a security policy established by the Google Apps administrator of your organization. Please contact your administrator for further assistance.", Uri:"" We're using google-api-dotnet-client and the code is straight forward enough

Google compute engine .NET API examples/samples/tutorials

荒凉一梦 提交于 2019-12-22 08:08:02
问题 I haven't been able to find anything that will clearly explain how to use google compute engine through the .net API (specifically c#). Is there anyone that can point me to anything? P.S. I know about the API reference (https://developers.google.com/resources/api-libraries/documentation/compute/v1/csharp/latest/annotated.html) 回答1: I could not find any detailed tutorial with code samples, but official documentation is available at [1] includes a code sample. There is a tutorial with C# sample

Google Auth runs in Visual studio but hangs when deployed to IIS

守給你的承諾、 提交于 2019-12-20 07:32:45
问题 I am working with the Google .Net client library. The way it works is when a user wants to authenticate to Google the library spawns a new webpage for the user to authenticate with. System.Diagnostics.Process.Start(authorizationUrl); My code using the library credential = GoogleWebAuthorizationBroker.AuthorizeAsync( GoogleClientSecrets.Load(stream).Secrets, scopes, userName, CancellationToken.None).Result; If I run this locally via Visual studio it works fine. However if I try to deploy it