I get credentials using code
 static string[] Scopes = { "https://www.googleapis.com/auth/userinfo.email" };
    private static UserCredential GenerateCredential()
    {
        UserCredential credential;
        using (var stream = new FileStream("credentials.json", FileMode.Open, FileAccess.Read))
        {
            // The file token.json stores the user's access and refresh tokens, and is created
            // automatically when the authorization flow completes for the first time.
            string credPath = "token.json";
            credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                GoogleClientSecrets.Load(stream).Secrets,
                Scopes,
                "user",
                CancellationToken.None,
                new FileDataStore(credPath, true)).Result;
            Console.WriteLine("Credential file saved to: " + credPath);
        }
        return credential;
    }
How to get email from this credential? I've tried code
private string GetEmailFromCredentials(UserCredential credential)
    {
        var plusService = new PlusService(new BaseClientService.Initializer()
        {
            HttpClientInitializer = credential,
            ApplicationName = "My Application",
        });
        var me = plusService.People.Get("me").Execute();
        var useremail = me.Emails.FirstOrDefault().Value;
        return useremail;
    }
but it looks like that People.Get("me") is not possibe anymore. I'm getting error "Google.Apis.Requests.RequestError Legacy People API has not been used in project 618254727025 before or it is disabled"
 
     
     
     
     
    