I am using Youtube Data API V3 to upload videos to my youtube account using Oauth 2.0 authentication.
UserCredential credential;
using (var stream = new FileStream("client_secrets.json", FileMode.Open, FileAccess.Read))
{
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
new[] { YouTubeService.Scope.YoutubeUpload },
"user",
CancellationToken.None
);
}
var youtubeService = new YouTubeService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = Assembly.GetExecutingAssembly().GetName().Name
});
Here during the authentication process it shows up login and Consent screen to get the authorization as shown
I need to overcome the above, so that without user consent I want the youtube data API V3 to be authenticated using OAuth 2.0 and do video upload to my account.
So I found that ‘Service Accounts’ can be used for this kind of scenarios but again found that service account do not work with Youtube data API because Service Accounts require an associated YouTube channel, and you cannot associate new or existing channels with service accounts for the link https://developers.google.com/youtube/v3/guides/moving_to_oauth Is there any alternative way in dotnet to skip the user consent and get authenticated programmatically and do a programmatically upload of videos to my account