When a user is taken to the authentication page for Google OAuth there are two options, select an account:
https://i.gyazo.com/e58272338236a472f1000b8aa1e426f6.png
or select an account then select a sub-account
https://i.gyazo.com/3e340c41a37f76c20541e1540c902035.png
I want to get the main-gmail account email address email@gmail.com rather than getting their sub YouTube email address such as name-9999@pages.plusgoogle.com
The scopes I use are:
Is there any way I can sort of bypass this or is there another scope I can use outside of this to access their main Gmail.
Edit: After looking through some more posts there was the same issue occurring here: Google OAuth2 Login - Get YouTube nickname and real email address Based back in 2013 quoting:
Interesting use case. Unfortunately there is no way to do this with one token at this time. The reason is that youtube channel is represented by a different object (almost like a user account) in the system. And an OAuth grant can belong to either the gmail user or the youtube channel. When we see the youtube scope in the request, we show a list of user id and any channels that the user may have and the approving user selects one of them. And the resulting token belongs to that object/account.
We are building new features related to delegation and channels. e.g. One possible solution may be to get a single token on the user account that gives you access to APIs on all channels that are managed by that account. Sorry, there is no ETA at this time.
Does anybody know of further developments relating to this as this would solve the issue aswell