Authentication given 401:Unauthorized exception
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS Server Security > Authentication given 401:Unauthorized exception




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Authentication given 401:Unauthorized exception  
rmunson8


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-15-06 12:21 AM

Here is my scenario.  I have an ASP.Net web service deployed to my IIS on a
2003 server machine as a web site at the root of IIS.  The web site has
Integrated Windows auth turned on and anonymous access off.

While running a client app (console app) from the same machine that the web
site is deployed to, I need to change the credentials to authenticate with t
o
a user that is different than the logged in user.  So, on the proxy object t
o
the web service, I set UseDefaultCredentials = false and set the Credentials
to an instance of NetworkCredential passing it the domain, username and
password.

When the web service is run, I get an 401:Unauthorized exception.

I have tried instead of setting the Credentials to a NetworkCredential,
rather I create a CredentialCache object and add a NetworkCredential instanc
e
to it with the AuthType = "Negotiate", but get the same error.

If I use the "Run As" feature to run the console app, and run it as the
other user in question, it works fine if I leave the
Credentials/UseDefaultCredentials properties alone.  But if i attempt to set
those to the other user, I get the same results.

The only thing that has worked is to force NTLM authentication via the
inetpub\adminscript\adsutil.vbs script.  When i force NTLM this way, it only
works if i set Credentials to a NetworkCredential.  If i set it to a
CredentialCache object, i get the same 401 error.

Luckily, this is a test only issue, so we won't be shipping this way, but
wanted to see if there was something else i have missed.

Thanks,
Ryan





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:25 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register