【问题标题】:asp.net Exception: The Local Security Authority cannot be contactedasp.net 异常:无法联系本地安全机构
【发布时间】:2013-05-27 16:31:54
【问题描述】:

应用程序调用处理程序表单其他(Windows 身份验证) windows认证下应用A调用应用B和应用B的处理程序

当我使用以下代码异常(无法联系本地安全机构)时显示 代码:

WebClient webClient = new WebClient();

            webClient.Credentials = new NetworkCredential(UserName, password, domain name);                

                string url = (handler url)

                webClient.DownloadFile(url, Context.Server.MapPath(imagePath));

【问题讨论】:

  • 我有两个应用程序 (A) 匿名身份验证和 (B) Windows 身份验证 (A) 从 (B) 调用处理程序
  • 尝试在用户名之外添加适当的域。检查凭据是否正确且未过期。

标签: c# asp.net windows authentication


【解决方案1】:

在我们的域中,您需要使用需要域来打开。例如域\我们的用户名

ASP.Net error: The Local Security Authority cannot be contacted

【讨论】:

  • 我有两个应用程序 (A) 匿名身份验证和 (B) Windows 身份验证 (A) 从 (B) 调用处理程序
【解决方案2】:

我的问题已通过更新代码解决

 WebClient webClient = new WebClient();
 var credCache = new CredentialCache();
 credCache.Add(new Uri(url), "Negotiate", 
     new NetworkCredential(serviceUserName, servicePassword, serviceDomainName));
 webClient.Credentials = credCache;
 webClient.DownloadFile(url,Path);

求助查看here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-04-23
    • 2016-10-21
    • 1970-01-01
    • 2010-12-02
    • 2016-07-05
    • 1970-01-01
    • 2010-09-19
    相关资源
    最近更新 更多