401 error accessing web service using credentials

B

Brad

I'm setting up my new pc with all my VS.net projects and I'm missing
something.....something I've done many times before without problem. I
have several asp.net apps accessing secure .net web services (secure meaning
windows authentication credentials must be used to access the web services).
The problem is that when the web apps attempt to access a web service they
are receiving 401: unathorized.

- The apps are all running on web sites on my pc.
- I have created the local user accounts
- Set up the web services to require windows authentication (both in the
web.cofnig and in the iis settings..anonymous is turn off) and to allow only
me and the user for app authentication.
- Required user is included in the folder level access permissions.
- I have accessed several of the service asmx files via web browser and I
authenticate successfully (I even removed my access in the web.config to
confirm that authentication would fail without)

In the web app that accesses the service I am using credential caching and
pre authenticating
Dim cache As New CredentialCache
Dim user As String = "myuser"
Dim password As String = "mypassword"
cache.Add(New Uri(ws.Url), "Negotiate", New NetworkCredential(user,
password, domain))
ws.Credentials = cache
ws.PreAuthenticate = True

In the web service configs
<authentication mode="Windows"/>
<authorization>
<allow users="mypc\wsuser, companydomain\myuser"/>
<deny users="*"></deny>
</authorization>

When I look at the security event logs I can see a Success event for NETWORK
SERVICE using the credentials, followed immediately by a Failure event for
SYSTEM using the same user name "Reason: An error occurred during logon".
On my old pc it works and the security event logs correctly shows the
supplied user name logging on instead of the SYSTEM user failure. I have
event changed the web apps to use my personal login information and the same
problem occurs.

Since these same apps work on my old pc and for others here. What the heck
am I missing?

Brad
 
S

Steven Cheng[MSFT]

Hello Brad,

I've found your another thread in the following newsgroup and have posted
some suggestion there:

Newsgroups: microsoft.public.dotnet.framework.webservices
Subject: RE: 401 error accessing web service using credentials

Please feel free to followup there if you have any further question or if
you have new finding.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top