Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Youtube Auth Sign In SDK

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

enter image description here

like image 929
Kristiyan Petrov Avatar asked Oct 19 '22 05:10

Kristiyan Petrov


1 Answers

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.

like image 92
Marc Chambers Avatar answered Oct 21 '22 00:10

Marc Chambers