Which NuGet package to install for OAuth authorization with Google API Dot Net Client? - api

I need to simply do this:
I need my application to use OAuth to get a user's full name, email address, gender and date of birth from Google.
I've got the whole deal about how to use OAuth. I've got the workflow and I could myself use the HttpWebRequest or the HttpClient to make requests myself and do it the raw way, which I actually prefer.
But, just to be safe, I want to use the Google API Dot Net Client. I have been reading through the vast amount of documentation about using this monstrous thing and I can't figure out a few basic things:
1) Which Google API do I need to use? Just the Google OAuth API will do? I see in the google dot net client library samples that they all get data from other Google services such as the Drives or Books services/APIs.
If I need just the basic information such as full name, email, gender and date of birth, which service do I need to query using the Google OAuth API?
2) Which NuGet package must I install? There're plenty of them with roughly the same names.
I've read a ton of stuff in the last 2 days about this and there are about 28 tabs open in my browser about this. The more I read, the more it adds to my confusion.
The NuGet package pages on the nuget website have no documentation at all. They must clearly state the purpose and the extent of services that the package provides. The latter is clearly missing. They all seem to have the same one line description instead, which is totally unhelpful.
I even took the source for the google-api-dot-net-client and tried compiling it. I didn't even know which Visual Studio version it was going to open in. I read the solution files in Notepad and they suggested that the version of 2012. So when I opened the solution in Visual Studio for Web 2012 Express, many projects did not open; it said they were incompatible with the version of Visual Studio. Also, the dependencies/references weren't loaded correctly.
I am using Windows 7 Home Premium. I've got Visual Studio Express versions from 2008 to 2013.
I need to use the OAuth API in an ASP.NET MVC application. I've seen various samples. I just need to know the basic set up information such as which binaries and which NuGet packages I need to get and from where.
Update
Hurray to hand-plumbing. I'm doing it by hand. Ditch the .NET client.

All Google.Apis NuGet packages are auto generated. As you can see there are packages for Drive, YouTube, Plus, Storage, AdSense, etc. You can read more about each package in our developers.google.com site. Take a look at the following:
https://developers.google.com/api-client-library/dotnet/ - Contains all the documentation for the .NET client library for Google APIs.
https://developers.google.com/api-client-library/dotnet/apis/ - Contains all the different Google APIs and several references to the API documentation, how to download it using NuGet, etc.
Check out our https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth page. It contains a lot of information about the OAuth 2.0 protocol and several snippets
In addition, just to let you know, you don't need to use any of that:
https://code.google.com/p/google-api-dotnet-client/source/browse/ contains only the core library code that is shared between all those different APIs. All APIs shared the same OAuth 2.0 protocol, the same HTTP components, the same media upload and download mechanism and so on. Every week I update the NuGet packages by running the NuGet publisher.
Hope it makes sense now.

Related

New Google Identity Service Migration with PHP Client library

I got a warning from google stating "your client ID(s) use the legacy Google Sign-In web solution".
And we are asked to migrate to the new Google Identity Services.
We do not use any JS library to sign-in. We have a Google PHP Client library for authentication and authorization.
Google still flagged our client Id and advised to migrate before March 31 2023.
Will this depreciation really affect us?
Can someone help me with the exact changes to be done on our end?
The team has a system that can detect which projects are calling the endpoint used by the deprecated JavaScript sign-in library. They send out emails to the owners of that project. From what I understand from the team they don't know for a fact that you are using it they can just see that your project id is hitting it.
The Google APIs PHP client library does not hit this end point so that part of your code is not the source.
I would just double check around your team and make sure nothing else may be using the old JavaScript library. If you cant find anything then the easiest solution is to just wait once google starts rolling out the deprecation at the end of March someone will come find you if something breaks.

Should I keep my client_secret.json hidden from user?

I have created a desktop .NET C# application, which utilizes Google API (particularly Google Drive) through official .NET library and OAuth 2.0.
According to the official example, I use GoogleWebAuthorizationBroker with client_secret.json file, downloaded from the Google Developer Console for my project. It is stated in the docs that I should keep my developer's secret private (which seems logical to me), but in the following examples, it is saved to a plain file, which is copied to application build directory during build. So application user is able to open my file and grab my secret.
Question: should I place client_secret.json content in a protected place (like maybe just hardcode its values in the most naive case), or am I missing something and a plain file is not insecure in this case?

Building a Custom API on top of Parse.com?

I'm planning on building a developer API similar to what Uber and Yo have done. Is it possible to build such API if my app's backend is powered by parse.com? I don't want my custom API pointing to parse, but instead my own site.
I'm planning on using ruby, and was wondering if there would be any limitations over other options (not sure what options I have). Thanks
I'm not sure if it is possible using ruby, but I know it's definitely possible to build your own REST API.
We have decided to go a bit further and wrote a parse-angular seed project for developing web apps. It can be found here.
After you pulled it, do a npm install
As usual,
cloud code should go into cloud/main.js
express code: cloud/app.js
angular code: cloud/public/js/
Note that: You will need to change your AppId and AppKey in
config/global.json
cloud/public/js/app.js
As for custom apis, you can define your own in cloud/routes/api.js.
At this point you should have a nice parse-angular project set up and good to go.
If there's anything wrong, please feel free to open a pull request. :)

Import google plus friend list using php

Could any one give me suggestion on how to get friend list on google plus using PHP.
Is there any plugin or widget to do this.It would be great to know.
Thanks in advance.
Your user needs to grant your app access to this information via the OAuth 2.0 scope https://www.googleapis.com/auth/plus.login and then you can use the REST API or client libraries to get the list of friends.
See the Google+ PHP quickstart for a sample application that accomplishes all of the steps necessary for what you want to do. The sample uses the Symfony framework to keep the code concise, but you should be able to take away how to do the same in your own PHP environment.
Also, see the Google APIs PHP client library that you can use in your project. This library is embedded in the quickstart via composer.

Dropbox - any API to cli_link?

I'm using the dropboxd service under Linux, which requires you to log into their website e.g. https://www.dropbox.com/cli_link?host_id=2173bf325f94beee3b1879d2c7b49e69 to link the machine to your account.
Is there any programatic way to do this (ideally using Java)? To access the website above it seems you need to login using forms (which seems tricky to do programatically), and their basic REST API (https://www.dropbox.com/developers/core/docs) doesnt seem to cover the cli_link command.
I could write an app to do the sync using their full API, but it seems like overkill since aside from the cli_link requirement the basic dropboxd does all that I need.
The official Dropbox desktop client is unrelated to the API, though both the API and the Linux CLI require user interaction on the Dropbox web site (once per link) to authorize the linking. Also, note that automating/scraping the site itself is not allowed by the terms:
https://www.dropbox.com/terms#acceptable_use
Not really a solution for DropBox users, but in the end we just moved over to use MediaFire instead. That has a full REST API and doesnt require any manual intervention.