ASP.NET - 401 exception in error console in firefox

Asked By anbu n on 22-May-11 10:24 PM
we have hosted same application in server xvz  in two different location but their one of the DB is in same server & other in different server.

here application with DB in same server , in that while saving in one of the page we're getting exception 401 , we can see the exception in error console in Firefox. we can t able to find the reason or original exception, whereas other same application with  DB in different server works fine
Nikhil Mahajan replied to anbu n on 22-May-11 10:34 PM
Http 401  error means :

The Web server (running the Web site) thinks that the HTTP data stream sent by the client (e.g. your Web browser or our CheckUpDown robot) was correct, but access to the URL resource requires user authentication 1) which has not yet been provided or 2) which has been provided but failed authorization tests. This is commonly known as "HTTP Basic Authentication". The actual authentication request expected from the client is defined in the HTTP protocol as the WWW-Authenticate header field.

Fixing 401 errors - general

Each Web Server manages user authentication in its own way. A security officer (e.g. a Web Master) at the site typically decides which users are allowed to access the URL. This person then uses Web server software to set up those users and their passwords. So if you need to access the URL (or you forgot your user ID or password), only the security officer at that site can help you. Refer any security issues direct to them.

If you think that the URL Web page *should* be accessible to all and sundry on the Internet, then a 401 message indicates a deeper problem. The first thing you can do is check your URL via a Web browser. This browser should be running on a computer to which you have never previously identified yourself in any way, and you should avoid authentication (passwords etc.) that you have used previously. Ideally all this should be done over a completely different Internet connection to any you have used before (e.g. a different ISP dial-up connection). In short, you are trying to get the same behaviour a total stranger would get if they surfed the Internet to the Web page.

If this type of browser check indicates no authority problems, then it is possible that the Web server (or surrounding systems) have been configured to disallow certain patterns of HTTP traffic. In other words, HTTP communication from a well-known Web browser is allowed, but automated communication from other systems is rejected with an 401 error code. This is unusual, but may indicate a very defensive security policy around the Web server.

Venkat K replied to anbu n on 22-May-11 10:48 PM
This is because of authentication problem.
This problem occurs when a Web service / web application uses Integrated Windows authentication, and the client passes the appropriate credentials correctly.
Additionally, this problem may occur more frequently when multiple threads on the client try to connect to the network at the same time.

1. Check whether Use Integrated Windows authentication is checked.
2. Check whether the user who is browsing the web application has complete access on web application and database.
3. Check the account on which the application pool is running has complete access on your db.

Thanks
TSN ... replied to anbu n on 22-May-11 11:12 PM
hi..

In any case, the errors indicate difference in user login and
authentication, and there are many ways to get in that state without
the user being aware (I just mentioned a few above; there are more).
You want to focus on your own misconfigurations and fix them.