【问题标题】:Cannot access virtual directory on another network server : Access denied无法访问另一台网络服务器上的虚拟目录:访问被拒绝
【发布时间】:2015-02-25 14:07:57
【问题描述】:

我有一个新的 ASP.NET 网页,我正在尝试(第一次)使用在 Active Directory 中定义的包含授权 AD 用户名称的安全组来保护应用程序。

我为应用程序定义了一个虚拟目录(另一台服务器上的目录)。虚拟目录是共享的,并且安全组(其中的各个用户是其成员)有权读取和写入相关服务器上的目录。

这一切都发生在同一个域上。

应用程序在单独的应用程序池中运行

以下是在WEB.CONFIG中

<authentication mode="Windows" >
</authentication>

<authorization>
  <deny users="?"/>
</authorization>

下面是一个按钮后面的一段测试代码

string theSSID = "";
if (Request.LogonUserIdentity.IsAuthenticated)
  {
  theSSID = Request.LogonUserIdentity.User.ToString();
  Label1.Text = "<br />Valid User : " + Request.LogonUserIdentity.Name.ToString() + " SSID = " + theSSID + "<br />";

  try
    {
    Label1.Text = Label1.Text + "<br />" + "A. Writing log file";
    string strFilePath = System.Web.Hosting.HostingEnvironment.MapPath(@"\Banking_UpLoad_Files\") + "CS_Log.txt";
    Label1.Text = Label1.Text + "<br />" + "B. Path For Log file " + strFilePath;
    StreamWriter sw = File.CreateText(strFilePath);
    Label1.Text = Label1.Text + "<br />" + "C. File " + strFilePath + "Written To Network Directory";
    }
  catch (Exception ex)
    {
    Label1.Text = Label1.Text + "<br />" + ex.Message;
    Label1.Text = Label1.Text + "<br />" + "2 .Access log from " + DateTime.Now.ToString();
    Label1.Text = Label1.Text + "<br />" + "2 .User: " + Request.LogonUserIdentity.User;
    Label1.Text = Label1.Text + "<br />" + "2 .Name: " + Request.LogonUserIdentity.Name;
    Label1.Text = Label1.Text + "<br />" + "2 .AuthenticationType: " + Request.LogonUserIdentity.AuthenticationType;
    Label1.Text = Label1.Text + "<br />" + "2 .ImpersonationLevel: " + Request.LogonUserIdentity.ImpersonationLevel;
    Label1.Text = Label1.Text + "<br />" + "2 .IsAnonymous: " + Request.LogonUserIdentity.IsAnonymous;
    Label1.Text = Label1.Text + "<br />" + "2 .IsGuest: " + Request.LogonUserIdentity.IsGuest;
    Label1.Text = Label1.Text + "<br />" + "2 .IsSystem: " + Request.LogonUserIdentity.IsSystem;
    Label1.Text = Label1.Text + "<br />" + "2 .Owner: " + Request.LogonUserIdentity.Owner;
    Label1.Text = Label1.Text + "<br />" + "2 .Token: " + Request.LogonUserIdentity.Token + "<br />";
    }
  }

  Label1.Text = Label1.Text + "<br />4. Complete <br />";

上面的代码在 .Net 服务器上运行时会产生以下输出

如果应用程序池设置为网络服务,则输出为

有效用户:RPS-DUNDEE\wilson SSID = ************************

A.写入日志文件 B. 日志文件路径\RPS-Nas-2\Finance\Banking Upload Files\CS_Log.txt

对路径“\RPS-Nas-2\Finance\Banking Upload Files\CS_Log.txt”的访问被拒绝。

2 .从 25/02/2015 12:47:31 开始的访问日志 2.用户:******************************** 2 .名称:RPS-邓迪\威尔逊 2.AuthenticationType:协商 2.ImpersonationLevel:模拟 2 .IsAnonymous: 假 2.IsGuest:假 2 .IsSystem: 假 2.所有者:S-1-5-32-544 2.代币:1680

  1. 完成

如果应用程序池设置为本地服务,则错误是

对路径“\RPS-Nas-2\Finance\Banking Upload Files\CS_Log.txt”的访问被拒绝。

如果应用程序池设置为可配置(用户名 = IWAM_DUN-SERVER3),则错误为

登录失败:未知用户名或密码错误。

谁能帮忙,因为这让我偏离了轨道。

提前致谢并感谢您提供的任何帮助

伊恩

【问题讨论】:

    标签: asp.net authentication active-directory


    【解决方案1】:

    “IWAM_DUN-SERVER3”是 AD 用户吗?

    如果不是,请在 AD 中创建!

    然后,尝试像这样定义您的应用程序池标识:IWAM_DUN-SERVER3@domain.com

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-12
      • 2021-12-12
      • 1970-01-01
      • 2021-02-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-19
      • 2012-09-11
      相关资源
      最近更新 更多