We help IT Professionals succeed at work.
Get Started

HTTP status 401: Unauthorized when connectiong to webservice - cannot authenticate from localhost

Last Modified: 2012-05-11
Hi. Weird one. We have a webservice secured in an asp.net website that requires windows authentication. This has been working for about 3 year. Last week one of th guys did some messing around trying to install some SSL certificates, adding IP addresses, etc.
Since then, we cannot authenticate to the webservice from the local machine – ie:

We have a webservice on server1 in a website using host headers. If we try to call the
webservice from another site on this server in asp.net code (passing valid  credentials) it gives us a 401 error. If we try to access the webservice from server 2 using the same credentials it lets us in. It just cannot seem to authenticate on server 1 when called from server 1.

We setup the webservice on server2 with the exact same settings. If we call the webservice that is on server 2 form server 2 it works. If we call the webservices that is on server2 from server 1 that also works.

Server1->server1 – does not work – 401 error
Server1->server 2 works
Server2->server1 – works
Server2->server2 – works

The credentials being passed are the same for all calls. The credentials are the default credentials from the credential store. If we test to ensure we have a valid user, we do in all cases. We have also tried explicitly passing a username, password and domain as a new set of credentials witht eh exact same results (it works for all bar server1->server1).
Any ideas?
Watch Question
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE