【发布时间】:2019-12-17 16:36:08
【问题描述】:
我有以下代码,我想通过此代码从浏览器获取令牌。我已经尝试使用 Process.Start(login) 但我不知道如何使用令牌获取响应。总结一下,我想运行我的桌面应用程序,然后打开浏览器,获取用户登录生成的令牌,然后关闭,这样我的应用程序就可以操作来自 Zoho 的数据。有没有办法使用这个解决方案或更好的解决方案解决方案
string scope = "ZohoProjects.projects.READ";
string responseType = "code";
string client_id = "100*****H";
string scrt = "02d1********3";
string state = "testing";
string redirect_uri = "https://www.getpostman.com/oauth2/callback";
string login = $"https://accounts.zoho.com/oauth/v2/auth?scope={scope}&client_id={client_id}&response_type=code&access_type=online&redirect_uri={redirect_uri}&prompt=consent";
RestClient client = new RestClient(login);
RestRequest request = new RestRequest(Method.POST);
var response = client.Execute(request);
【问题讨论】:
-
有一些解决方案 (stackoverflow.com/questions/27930226/…),但如果可以的话,直接在应用程序中嵌入 WebView 会更容易
-
你可以使用任何数据库吗(SQL, MYSql)。