我正在尝试使用简单的C#控制台应用程序获取Google授权码。 整个过程非常简单:使用包含唯一客户端ID的URL向Google Oauth2端点发送请求,登录到Google帐户,然后获取授权码。
我该如何从 Google Chrome 中获取生成的代码并将其传回我的应用程序?
string url = "https://accounts.google.com/o/oauth2/v2/auth?whatever";
Process.Start("chrome.exe", url); // open up browser so user can log in
// get the auth code from chrome
我该如何从 Google Chrome 中获取生成的代码并将其传回我的应用程序?