I am using with Google's OAuth 2.0 Playground using my own personal Google account, but I cannot seem to recover my Gmail address using the playground. I am using the api url https://www.googleapis.com/oauth2/v3/userinfo. But didn't get email address. I get various information about the user such as family name, first name, gender, picture, etc. I have referred with Google OAuth API to get user's email address? but it didn't work. I am using the code(c#-windows form) below(to get email address & user information)
string userinfoRequestURI = "https://www.googleapis.com/oauth2/v3/userinfo
HttpWebRequest userinfoRequest = (HttpWebRequest)WebRequest.Create(userinfoRequestURI);
userinfoRequest.Method = "GET";
userinfoRequest.Headers.Add(string.Format("Authorization: Bearer {0}", access_token));
userinfoRequest.ContentType = "application/x-www-form-urlencoded";
userinfoRequest.Accept = "Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
WebResponse userinfoResponse = await userinfoRequest.GetResponseAsync();
//userinfoResponse.
using (StreamReader userinfoResponseReader = new StreamReader(userinfoResponse.GetResponseStream()))
{
// reads response body
string userinfoResponseText = await userinfoResponseReader.ReadToEndAsync();
output(userinfoResponseText);
}