在.NET中进行缩放集成时出错


public void OAuthRedirect(string code)
{
RestClient restClient = new RestClient();
RestRequest request = new RestRequest(); 
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
request.AddParameter("grant_type", "authorization_code");
request.AddParameter("code", code);
request.AddParameter("redirect_uri", ConfigurationManager.AppSettings["RedirectUrl"]);
request.AddHeader("Authorization", string.Format(AuthorizationHeader));
restClient.BaseUrl = Convert.ToString(new Uri("https://zoom.us/oauth/token"));
//restClient.BaseUrl = new Uri("https://zoom.us/oauth/token");
var response = restClient.Post(request); 
if (response.StatusCode == System.Net.HttpStatusCode.OK)
{
System.IO.File.WriteAllText(ConfigurationManager.AppSettings["TokenFilePath"], response.Content);
var token = JObject.Parse(response.Content);
this.GetUserDetails(token["access_token"].ToString());
//return RedirectToAction("Index", "Home");
} 
//return View("Error");
}

当我试图使用此代码创建令牌时,我会得到一个错误:

基础连接已关闭:发送时发生意外错误

将以下内容添加到代码中:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

最新更新