Search code examples
flutteroauth-2.0youtubegoogle-oauthyoutube-data-api

Flutter login to both google and youtube


I am using oauth2 to login user to my app. One of my app's feature is to let user browse youtube by his/her signed in account through webview. But the problem is that, user needs to sign in to youtube first time the webview is shown. Is there any way to avoid this, i,e, get the user automatically logged in to his/her youtube account based on the google account he/she logged in


Solution

  • A users YouTube data is private user data, you will need to be authorized to access that.

    user needs to sign in to youtube first time the webview is shown.

    In order for a user to consent to your access, and be authorized to access their data. The user must first be signed in to their Google Account, after that the user will be allowed to choose which YouTube Channel they would like to grant your application access to.

    The YouTube API is channel based. A user must first log into their google account only then can they choose the channel. There is no way around this its how it works.