Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Youtube API V3 authentication. Uploading to shared account

$
0
0

I'm trying to update an existing Asp.Net application using C# to avoid the Youtube V2 API deprecation. The 1st challenge is figuring out how to authenticate using the new API.

This is how the application currently authenticates:

    string developerKey = (My Developer Key here);    string username = (My username here);    string password = (My password here);    ytService = new YouTubeService("SampleApplication", developerKey);    ytService.setUserCredentials(username, password);

I've researched, and reviewed the V3 API examples, and they all use OAuth2 to Authenticate like this:

        UserCredential credential;        using (var stream = new FileStream("client_secrets.json", FileMode.Open, FileAccess.Read))        {            credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(                GoogleClientSecrets.Load(stream).Secrets,                // This OAuth 2.0 access scope allows an application to upload files to the                // authenticated user's YouTube channel, but doesn't allow other types of access.                new[] { YouTubeService.Scope.YoutubeUpload },"user",                CancellationToken.None            );        }

However, that prompts the user to login to their own Google account, and for this application we want all uploaded videos to go into our account. Therefore I would like to continue using the Public API access if possible, and I can't find any examples of this for the V3 APIs.

I've also investigated OAuth2 Service Account, but for the life of me can not figure out how to authenticate using one of those.

Can you help point me in the right direction?


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>