In my web app, I have to ask the users for permission to access their YouTube channels.
The authentication url is something like this:
"https://accounts.google.com/o/oauth2/auth?client_id=myClientId&redirect_uri=http://my.redirect.uri&scope=https://www.googleapis.com/auth/youtube.readonly&response_type=code&access_type=offline&approval_prompt=force"
This URL prompts the user to choose a YouTube channel. But in the channel list, the Google/YouTube account also appears. This account isn't linked with any channels directly.
In my app, the users are supposed to select only a channel. My question is, how can I tell if the user selected a channel and not the Google/YouTube account? Is there some method in the YouTube API that can help me know?
I noticed that if the user has selected a channel and I call the channels/list method then the information it returns is as expected but if I call the same method having selected the Google/YouTube account then the channel title is empty. But I'd like to know if there is some other (nicer and cleaner) way to tell if the user has selected a channel or an account.
Thanks!!