Following the guide https://developers.google.com/identity/sign-in/android/sign-in doesn't allow me to specify the channel for youtube sign in
I requested the following scopes
new Scope("email"),
new Scope("https://www.googleapis.com/auth/youtube.readonly"),
new Scope("https://www.googleapis.com/auth/yt-analytics.readonly")
Then
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestScopes(new Scope(Scopes.EMAIL), scopes)
.requestServerAuthCode(activity.getString(R.string.google_token_id), true)
.build();
googleApiClient = new GoogleApiClient.Builder(activity)
.enableAutoManage(activity, this)
.addApi(Auth.GOOGLE_SIGN_IN_API, gso)
.addConnectionCallbacks(this)
.build();
While what i would like to implement a sign in like youtube does...
Where you can choose the channel you would like to connect.
I know that using a webView and OAuth 2.0 i can select the channel but i would like to do it with Android sdk for auth like youtube does...
Thank you for any insight
The channel selector is unfortunately not available in the Android native sign-in flow. Using the native flow and the 'youtube' auth scope will yield a token for the account's "default channel": https://support.google.com/youtube/answer/6019090?hl=en
To access the channel selector, you'll need to use the web-based flow as you mentioned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With