Re: Trying to pass NetworkCredential to WebService



Hi Marshall,

When your webservice's virtual dir requires Authentication(disabled
anomymous), the clientside need to provide a certain credential for
authentication. For your scenario, that's the ASP.NET webapp. So in your
ASP.NET's webservice calling code, we need to attach a NetworkCredential to
the webservice proxy instance.

As for the further problem you mentioned,
==================
So this still is a problem because my web service needs to run in
its own pool because I tie Sql Server permissions to its identity.
===================

would you provide some further description on this? Based on my
understanding, your ASP.NET webservice can surely to running in its own
application pool (with its own identity) different from the ASP.NET
webapp's.

Looking forward to your response.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Marshall" <marshall@xxxxxxxxxxxxxxxx>
| References: <OqRQFA9hFHA.2904@xxxxxxxxxxxxxxxxxxxx>
<JUjsKACiFHA.2800@xxxxxxxxxxxxxxxxxxxxx>
<#GmyXSGiFHA.2180@xxxxxxxxxxxxxxxxxxxx>
| Subject: Re: Trying to pass NetworkCredential to WebService
| Date: Thu, 14 Jul 2005 07:52:46 -0400
| Lines: 34
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
| X-RFC2646: Format=Flowed; Response
| Message-ID: <u7BlPqGiFHA.4000@xxxxxxxxxxxxxxxxxxxx>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
| NNTP-Posting-Host: 66-195-172-195.gen.twtelecom.net 66.195.172.195
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:7405
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
|
| Actually, my statement was incorrect. The problem was that my web
service
| was running in its own application pool with an identity of a domain
| account. So this still is a problem because my web service needs to run
in
| its own pool because I tie Sql Server permissions to its identity.
|
| "Marshall" <marshall@xxxxxxxxxxxxxxxx> wrote in message
| news:%23GmyXSGiFHA.2180@xxxxxxxxxxxxxxxxxxxxxxx
| > Thanks Luke,
| >
| > Yes, the web service is set to use Integrated authentication and
anonymous
| > access is disabled.
| >
| > My code was passing credientials like you illustrated. The link you
| > attached guided me to another kb article which solved my problem.
| >
| > http://support.microsoft.com/kb/811318/EN-US/
| >
| > I changed my code to use the CredentialCache class and it worked like
| > this:
| > localhost.Service ws = new localhost.Service();
| >
| > System.Net.CredentialCache cache = new System.Net.CredentialCache();
| > cache.Add( new Uri(ws.Url), "Negotiate", new
| > System.Net.NetworkCredential("userName", "password", "domain"));
| > ws.Credentials = cache;
| >
| > Response.Write(ws.HelloWorld());
| >
| > Thanks,
| >
| > Marshall
| >
|
|
|

.



Relevant Pages

  • Re: File Upload Web Service
    ... the uploaded files in a web service just the same as a web form. ... I found that the Request.Files collection is accessible in both a web form ... > webservice. ... as for implementing authentication mechanism ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: User Security?
    ... The authentication is "Integrated Windows Authentication". ... Currently I am trying to access the web service thru IE6. ... you're developing an ASP.NET webservice which hosted ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Problem with web service credentials
    ... I guess you have impersonation turned on in you website and the webservice is on another computer. ... Implement Kerberos authentication. ... error stating that it is unauthorized to call the web service. ...
    (microsoft.public.dotnet.general)
  • Re: Security setting help required in web.config file.
    ... browser on machine3 to the web server on machine2. ... account synchronized with the web service machine. ... Authentication, Role-based Security, and SQL Reporting Services Web ... webservice is deployed in this machine. ...
    (microsoft.public.dotnet.framework.aspnet)
  • How to call a web service using NT Authentication from Web Service
    ... Authentication" only and they are both assigned to application pool with ... Domain Account. ... (ws is a web service proxy request instance) ...
    (microsoft.public.dotnet.languages.csharp)