4

Normally in Web Authentication for YouTube Data API after I select Google Account, list of channels managed or owned by Google Account is listed. It's also the same for API Explorer for YouTube Data API. In the Android client library for YouTube Data API, the list of channels is not coming. It's selecting the default channel automatically for the selected Google Account. Here are some screenshots for the Web Authorization.

Web OAuth2 in API Explorer:

For Web OAuth2 in API Explorer

OAuth2 in Android:

Web OAuth2 in Android

I tried setting scopes for YouTube Services like YOUTUBE or YOUTUBE_READONLY, but it's still the same result. Is there any solution for this situation.

I found a similar problem, but the question is too old and in the answers there are no native solutions for this problem.

People recommend Web OAuth2 (login in browser), but I'm looking for an Android client solution. Is there any new solution to this problem or do I still have to go with Web OAuth2 in Android client?

stvar
  • 6,551
  • 2
  • 13
  • 28
enes
  • 91
  • 8

1 Answers1

3

I asked the same question to Google, through its own issue tracker site. Here is the answer I got (on Feb 4, 2021):

Status: Won't Fix (Obsolete)
Hi, Yes, that is correct. There isn't a native Android account switcher library. The only way you can do so, is to use OAuth 2.0 for both web and android. It gives the user a choice to pick the channel they want to authorize and give access. Here is a documentation with steps on how to create a project with OAuth2.0 for reference.

So you have to implement it with Web OAuth2, there is no solution for channel switching with native Android client library of YouTube Data API for now.

stvar
  • 6,551
  • 2
  • 13
  • 28
enes
  • 91
  • 8