我们有一个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)"
答案 0 :(得分:0)
以域用户身份运行进程(IIS进程或ASPNET进程)。这意味着设置应用程序池标识。
在IIS5中,将匿名帐户(IUSR_MACHINE)设置为域用户,然后使用模拟。
在IIS的更高版本中,将服务帐户添加到IIS_WPG组。