Hello!
Please help me to solve one annoyed problem:
I got the error message “Login Failed for user 'NT Authority\Anonymous LOGON'” in my asp.net application when my Web Server and DB Server are on different machines.
What is inside my web.config:
<authentication mode="Windows"></authentication>
<authorization>
<deny users="?" />
</authorization>
<identity impersonate="true"></identity>
What is inside my aspx server code:
SqlConnection connection = new SqlConnection(@"Data Source=HP\SQLEXPRESS;Initial Catalog=CMDB;Integrated Security=SSPI;");
connection.Open();
…
I also unchecked ‘Anonymous access’ checkbox on the web application’s Security tab (IIS version 5.1).
Note that if I run the same above-mentioned code in test Windows app from the Web Server machine, it works fine!
Note also that code WindowsIdentity.GetCurrent.Name() placed in asp.net page correctly returns my user domain account.
So I can‘t desperately realize how can I fix the problem and why Web Server tries to connect to DB machine under 'NT Authority\Anonymous LOGON' though impersonation as you can see is on and my web application works under my domain account.
Thanks in advance for any help!
Please help me to solve one annoyed problem:
I got the error message “Login Failed for user 'NT Authority\Anonymous LOGON'” in my asp.net application when my Web Server and DB Server are on different machines.
What is inside my web.config:
<authentication mode="Windows"></authentication>
<authorization>
<deny users="?" />
</authorization>
<identity impersonate="true"></identity>
What is inside my aspx server code:
SqlConnection connection = new SqlConnection(@"Data Source=HP\SQLEXPRESS;Initial Catalog=CMDB;Integrated Security=SSPI;");
connection.Open();
…
I also unchecked ‘Anonymous access’ checkbox on the web application’s Security tab (IIS version 5.1).
Note that if I run the same above-mentioned code in test Windows app from the Web Server machine, it works fine!
Note also that code WindowsIdentity.GetCurrent.Name() placed in asp.net page correctly returns my user domain account.
So I can‘t desperately realize how can I fix the problem and why Web Server tries to connect to DB machine under 'NT Authority\Anonymous LOGON' though impersonation as you can see is on and my web application works under my domain account.
Thanks in advance for any help!