Search code examples
c#asp.netoauth-2.0youtube-apigoogle-client-login

.net Youtube api v3 upload videos to an specific account


I have a web application in .NET with youtube api v2 that uploads my clients videos to my companny channel, I want to migrate the youtube api to v3 but the ClientLogin is deprecated, when a client try to upload a video with oauth 2.0 the video uploads in the channel of my client, not in the company channel, there is a way to upload videos in one specific channel like in youtube api v2?


Solution

  • The problem you are having is that when your client authenticates they are authenticating to their personal account. You want to allow them to upload to your account. To do that you are going to have to authenticate the application to your account save the refresh token and use that to allow them to upload to your account. If this is a web application that shouldn't be to hard as you can save this refresh token on the server some place and use that to allow anyone to upload to your account.

    With any other API I would say to create a service account to allow people to upload to your account but unfortunately for us the YouTube API doesn't allow for service accounts nor does it allow you to grant someone else access to your account we have to hack it in this way.

    I hope this makes a little sense if not let me know and I will try and help. This was a little long for a comment.