I am using google's OAuth2 login system (php library) and I want to get user's real email address as well as details for his youtube channel (with his permission). I have tried using the following scopes:
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
https://www.googleapis.com/auth/youtube.readonly
but the returned email address has the format: @pages.plusgoogle.com (which is not the real email address).
If I use only the two scopes:
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
I am able to get the real address but I cannot access any youtube data.
I have also tried to use two different requests to google api. The first to grab the user info and a second one to get youtube related details. In this case the problem is that I do not have a unique key value to identify the user as the same person on my side (an ID or something to identify a user uniquely).
I believe my problem is related to this question: Google OAuth2 Login - Get YouTube nickname and real email address
Any help would be appreciated.