Google Drive example: oauth2callback not found

I need a little help with a sample C # program for Google-Drive ...

I used this so-called "tutorial" / "example":
https://developers.google.com/drive/examples/dotnet

And the code from here:
https://code.google.com/p/google-drive-sdk-samples/source/checkout

I uploaded my (only slightly modified) source code here if someone does not have Mercurial (I did not have Mercurial and no administrator rights to install it), and Mercurial is the only way to get the source code ...):
http://verzend.be/elt0k13enraw/DrEdit.rar.html

I always get

"Ressource not found"

Requested URL: / oauth2callback

I do not find this surprising since no controller or oauth2callback handler is running ...

I tried adding a controller called oauth2callbackController and redirecting to another action in oauth2callbackController.Index by doing

return new RedirectResult("/about/about"); 

But this only throws a NULL reference exception.

So, I realized maybe the controller is wrong and redirected to

 return new RedirectResult("/drive/Index"); 

But this only creates an infinite redirect loop -> allow -> redirect - allow -> etc.

BTW, the configuration for changing the API + REDIRECT_URI key is in

 Models\ClientCredentials.cs 

Note:
The problem is not in my modifications.
The sample also did not work without changes, with the same error.
All I did was remove the EntityFramwork references and throwing an “Exception not implemented” when calling a method using an entity.

Edit:
Additional Information:
What I really wanted to do first of all was to write a console service that exports my database, LZMA-compresses the exported content, encrypts it using OpenPGP and uploads my server database to Google’s disk every day at 24:00 o ' , without user input.

I got export without problems, I got LZMA compression without problems, I got encryption with PGP without problems. After the end of the working day (grrrr), when I was at home, I was even able to download the sample code using the mercury installed on my Linux machine at home and bring it to the Windows machine using SMB ...

But now I can’t get a sample for Google-drive SDK ...
And what's more, I really need an example for a console service / daemon, not a web application. When I created the API key, I saw that you can create a key for the service, but there is no example on how to write a Google-Drive service (console application), and without useful documentation (yes, there is a link, but this is only a link, IntelliSense provides about the same) ...

+2
source share
1 answer

When configuring your application on the Access API tab in the API console, you need to set the root directory (/) of your web server as a redirect URI, not / oauth 2callback.

Assuming your application is published on www.example.com, just go back to the API console and install it on www.example.com, not www.example.com/oauth2callback

+6
source

Source: https://habr.com/ru/post/920546/


All Articles