Use Service account with Google API like youtube, picasa in web asp.net mvc 4 / JavaScript - asp.net-mvc-4

I come in order to have some information about Google API and particularly the authentication "Service account"
I have the same problem that this guy is having, and although that concerns another API, he explains the problem very well.
For a few days now I have already read some articles:
Google dev
DrEdit for .Net
C# sample
I have already registered for a Google API account and I am using the Client Key and Secret that was provided to me. I then downloaded the following libraries:
google-api-dotnet-client-1.2.4737-beta.source.zip
youtube-api-samples
google-youtube-v3-rev35-csharp-1.2.0-beta
Nothing has helped me so far...
I would like to know if Picasa web and the Youtube API v2 or v3 can use oAuth2.0 Service account as I am not able to find anything about that. I am currently using Picasa Web oAuthv1.0 and I found it really easy to use but I would like to migrate to Google Youtube API v3/Picasa web API.
The basic workflow idea:
Private Pictures and videos are created specifically for a web site.
Users will log into the site (it isn't a Google users) and see pictures and videos -> All users that successfully log into the site have access to all youtube videos and picasa pictures and this medias are private in Google
The only example I've found anywhere that shows how to use authentication was in a ASP.NET MVC project that unfortunately requires user interaction and i don't want that.
Can someone please me on this? Does anyone has a piece of code written in Javascript or C# for connecting to the API with Service account or is it better for now to authenticate with oAuthv1.0? Any help will be highly appreciated!!

Take a look in Which Google APIs can be accessed with service account authorization? it contains a list of all APIs which support service account.
As far as I know, Picasa and Youtube don't support service account.

Based on the article posted by peleyal, it is my intepretation that YouTube should support the service account. In the answer on the related article, it states "All Google APIs that supports OAuth 2.0 should work with Service Accounts".
Assuming YouTube is a Google API, it also should work.
I'm not 100% confident in that answer unfortunately, because I have seen documentation elsewhere that says Service Accounts: "Several Google APIs act on behalf of an application and do not access user information." https://developers.google.com/accounts/docs/OAuth2#serviceaccount
Does accessing the YouTube APIs constitute "user information"? The answer to that question is the reason I'm not 100% confident without trying it. An expensive time proposition.

Related

I can't log in to my dashboard through a shopify api

I cannot log in to shopify through an api.
I want to build a private app with a shopify api, and I just created a laravel project and connected it to shopify through an api. I am using 'ohmybrew' and wrote my api credentials in my config. I tried to log in through an api but I get an error as follows.
Oauth error invalid_request: The Shopify API application does not support oauth
I expected to go to my dashboard but it did not work. It's my first time to work with shopify, and I am baffled as to what to do. I would appreciate it if someone could tell me what I am doing wrong.
oAuth is well established. You could probably say almost all systems with a public API support oAuth. Shopify is no different from any of them, and they all follow the same pattern. So it seems your attempt to follow that pattern is incorrect. The best thing you can do then is to look up some tutorials on how to connect to an API using oAuth, with an emphasis on your scripting language so you can have some solid code examples to follow. Once you master oAuth, you'll be able to see your dashboard.

Using Google Contacts API with titanium

I am new to titanium and am trying to make a directory of contacts using Google Contact API. I have read up on it yet aren't seeing too many helpful examples. I know I need authentication yet I can't seem to figure out where to start. Any help is appreciated.
You may know some of this already but here's the broad strokes overview for others and an answer to your question (Any help is appreciated).
You need to create an (Google) account and register your project/application first in order to make requests for non-public user data. The request must include an access token. The token also identifies your application to Google.
In order to authenticate a user/application: You will need to Use OAuth 2.0 to authorize requests. You must register your project in the Google API Console and enable the Contacts API service in order to use OAuth 2.0.
To implement the OAuth protocol in a Titanium app you can follow along with the sample/tutorial in this blog post:
OAuth Login for Titanium

Youtube API: Upload to developer's account

here's what I want to achieve:
Users are able to upload videos to my youtube account via a simple web form.
Here's what I don't get:
This is possible using the deprecated ClientLogin authentication.
But it is not using OAuth 2.0 authentication, because this one's logging the user always in to his own account, not mine. Correct? If not, how do I use the OAuth authentication to enable users to upload videos to my youtube account?
Thank you for your help!
OAuth2 Service Accounts do not work for Youtube API:
https://developers.google.com/youtube/v3/docs/errors
This error is commonly seen if you try to use the OAuth 2.0 Service
Account flow. YouTube does not support Service Accounts, and if you
attempt to authenticate using a Service Account, you will get this
error.
If this issue is still
https://code.google.com/p/gdata-issues/issues/detail?id=5370
UNRESOLVED it is NOT possible to use Service Account with YouTube v3 data API. As of March 2014 I am not able to create/list new Playlist or post a video to an existing playlist.
The Google folks should REALLY make this explicit as I waste few hours with this.
Google's OAuth2 authorization server supports the use of Service Accounts. They are meant for exactly this use case. This should work for the Youtube API too.
You can create a Service Account in Google's API Console. There you get a Service Account email address, that you have to setup as alternative email address for the Google account you use for your Youtube videos.
Does Jan Gerlinger's answer work? I also get the error saying that the email address is already associated to an other Google account.
I guess it's not possible with v3, but can it be done with v2?

rails: google affiliate network API oauth when API does not support Service Account model

Update 1: as I delve deeper, this isn't really anything to do with Rails, it's more of a question about how to have a server access our account using credentials provided by Google when the API we're calling doesn't support the Service Model
I have a server application that needs to connect to Google API from Rails. I can authenticate with OAuth2 successfully using the google-api-ruby-client gem and get other APIs working. There are several samples that use the gem, but most assume you want a user to authenticate themselves in a web environment. Others support what Google calls a "Service Model" where it's really the app validating itself. I have that working, too.
However the specific API I am querying is Google Affiliate Network (GAN), which does not support the Service Account model. In particular, I need a server to be able to authenticate with OAuth2 without any user interaction. I have done this using OAuth in several other contexts, but am struggling to get it working in this case.
Does anyone know of working Rails code for GAN?
Update 2: I am searching this google document on API authorization for strategies that don't require user interaction.
I found a workable solution -- it uses Google's "Installed Application" approach, which needs one bit of manual setup, but is otherwise a working solution.
https://gist.github.com/3543368

Google Account to sign into a third-party website

I want to use google/yahoo ids to be used to login to my website.
As its done in stackoverflow.
Can any one provide me a starting point.
That authentication method is called OpenID. You can get details at the open id website.
If your webiste uses PHP on the server, here's a resource to get you started with OpenID and PHP
UPDATE
Since I've posted this, the world of open federated authentication has evolved quite a bit. If you're interested in this you may wish to look up OAuth v2 online, or check out these links: www.oauth.net and the Google resources on OAuth2 available here.
OAuth builds upon the concepts of OpenID and it expands the functionality quite a bit, in particular in the areas of not just providing authentication but also providing authorization for applications using a centralized provider of the user's choice (i.e. Google, Facebook, Twitter or your own :) )
I have been using JanRain for the same thing. It is free and integrates with loads of different login providers, such as, Facebook, Twitter, Google, OpenId (generally), yahoo, msn, and many more.
There is code that lets you integrate it with almost any programming language/platform you want.
try this sample in CodeProject.
http://www.codeproject.com/KB/web-security/OpenIdFormsAuth.aspx
It worked fine with me.