Get user email using Youtube API

前端 未结 1 594
囚心锁ツ
囚心锁ツ 2021-01-16 15:00

How can I get authenticated user email using Youtube API?

I tried using channels.list:

GET https://www.googleapis.com/youtube/v3/channels?part=brandin

相关标签:
1条回答
  • 2021-01-16 15:32

    To get a user's email address, you'll need to get their permission first during OAuth. Google's OAuth has a scope specifically for this. I'm not familiar with the Node.js youtube-api module, but you'll have to get it to include an additional OAuth scope: https://www.googleapis.com/auth/userinfo.email. Then the email address will be available in the response from a request to http://googleapis.com/oauth2/v1/userinfo.

    This post may be helpful: http://javascriptplayground.com/blog/2013/06/node-and-google-oauth/

    0 讨论(0)
提交回复
热议问题