using (var stream =
new FileStream("client_secret.json", FileMode.Open, FileAccess.Read))
{
string credPath = System.Environment.GetFolderPath(
System.Environment.SpecialFolder.Personal);
credPath = Path.Combine(credPath, ".credentials/drive-dotnet-quickstart.json");
credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
Scopes,
"user",
CancellationToken.None,
new FileDataStore(credPath, true)).Result;
Console.WriteLine("Credential file saved to: " + credPath);
}
This piece of code from here handles the authentication of an application and saves a user credential file.
But, it does so using a browser. I read, somewhere, that google no longer supports the checking of raw username & passwords, and instead have the user login via the browser.
Can I not embed a browser in my C# application, and have the authentication done in here, instead of annoyingly opening a browser?