【问题标题】:Error occurred during zoom integration in .NET在 .NET 中进行缩放集成时出错
【发布时间】:2022-11-20 22:26:07
【问题描述】:
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");
}

当我尝试使用此代码创建令牌时,出现错误:

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

【问题讨论】:

    标签: c# .net asp.net-mvc asp.net-web-api zoom-sdk


    【解决方案1】:

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

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 |安全协议类型.Tls12 |安全协议类型.Tls11 |安全协议类型.Tls;

    【讨论】:

    • 您绝对不想启用那些过时的安全协议。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-04
    • 1970-01-01
    • 2021-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-11
    相关资源
    最近更新 更多