Passing Credentials to a Web Service
From: Ramjee Tangutur (anonymous_at_discussions.microsoft.com)
Date: Thu, 19 Feb 2004 05:41:07 -0800
We have a web service (developed in C#). This web service is hosted in an extranet domain. A Windows Forms application is the consumer of this web service. The client can call the web service in two scenarios that is the client can be a part of the Corporate Intranet or the client can be in some remote location and access the web service over RAS.
We pass the credentials to the Web Service call as below…
1. WebServiceObject.Credentials = Credentials.DefaultCredentials(); --> This will be used if the client is in Intranet
2. WebServiceObject.Credentials = new NetworkCredentials(“UserID”,”Password”,”Domain”); --> This will be used if the client is in extranet.
Our Application has proper logic to determine if the client app is in Intranet or in Extranet.
Now the problem that we face is, the credentials are not getting passed if we use the statement 2. We looked at the IIS Log from (C:\Windows\System32\LogFiles\...). Here from the log we saw that NULL credentials are getting passed.
The following is the IIS configuration which hosts the Web Service.
1. OS --> Windows Server 2003
2. IIS Ver --> 6.0
3. Uses Application Pools
4. App Pool Identity --> “Local System”
5. Authentication on the Vir Dir --> “Integrated Windows” and “Digest”
Any pointers on what could be going wrong will be of great help. Please let us know, if we are missing some extra settings.
*** Please mark a cc of this reply to firstname.lastname@example.org and email@example.com ***
Thanks & Regards,
Microsoft India Community Star (.NET)