1
votes

I am using javascript sdk to authenticate google. In my webapp I am trying to upload video to youtube.

A youtube account might have multiple channels and I want to select the channel and send the information to the server with access token and all required value to upload a video.

I can authenticate a user from google but how can I display the youtube channel selection ui and also if there is no channel in the account I want to show error.

I have gone through youtube api but I found it very complex

Need help

1

1 Answers

1
votes

YouTube is very different from other Google APIs. When your user authenticate your application they are not just authenticating you to YouTube you are actually getting authenticated to a single YouTube channel.

If you want to see the account selection you are going to have to force them to re authenticate you will then get a new access token associated to the channel that they pick.

prompt=consent should force them to re-authenticate but that depends on how you have implemented things.

Recap:

If a user has 5 channels you will to authenticate them once for each channel you will then have five access tokens each of which grants your application access to a single channel.