0

我们有一个 ASP.Net Web 应用程序,它的 App Pool 的标识是“网络服务”。在这个应用程序中,我们有一个设置页面;那里我们接受用户名。我们在针对 ADSI (Active Directory) 验证用户名时遇到以下异常。如果我们将应用程序池的身份从“网络服务”更改为我们的域帐户,那么我们就可以成功验证用户名。

在这里,我们不能使用我们的域帐户作为 App Pool 的身份。请提出任何替代方案来解决此问题。

Exception Information
*********************************************
Exception Type: System.DirectoryServices.DirectoryServicesCOMException
     ExtendedError: -1073740781
      ExtendedErrorMessage: C0000413: LdapErr: DSID-0C0904DC, comment:      AcceptSecurityContext error, data 78f, v1db1
          ErrorCode: -2147023570
Message: Logon failure: unknown user name or bad password.

    Data: System.Collections.ListDictionaryInternal
    TargetSite: Void Bind(Boolean)
       HelpLink: NULL
     Source: System.DirectoryServices
     HResult: -2147023570

    StackTrace Information
      *********************************************
   at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
      at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
      at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
   at System.DirectoryServices.DirectorySearcher.FindOne()
         at.-------UserSettings.IsValidUser(String userName)"
4

1 回答 1

0

以域用户身份运行进程(IIS 进程或 ASPNET 进程)。这意味着设置应用程序池标识。

在 IIS5 中,将匿名帐户 (IUSR_MACHINE) 设置为域用户,然后使用 .

在更高版本的 IIS 中,将服务帐户添加到 IIS_WPG 组。

于 2013-05-13T12:36:07.057 回答