Re: HELP with Impersonation



Hello,

you need to add a

<configuration>
<system.web>
<authentication mode="Windows" />
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</configuration>to you web config.

Then the impersonation should work as expected.

Greetings,
Henning Krause

"blue_nirvana" <bluenirvana@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:EDFF1F86-E151-452E-8132-3CEF20889E6C@xxxxxxxxxxxxxxxx
I'm new to the impersonation thing and so I was hoping I could get some
help.
I have a Web Service that is setup to use Integrated authenication with
anonymous access turned off. I call the web service using:

Dim ws as New Webservicename.Service1()
ws.Credentials = New NetworkCredential("username", "password", "domain")
ws.DoSomething()

The web service works perfect if I have the following:

<identity impersonate="true" userName="domain\username"
password="password"/>

located in the webconfig file, but does not work if I use:

<identity impersonate="true" />

Using either one, I get authenicated using the credentials I pass in. I
can
see this by using WindowsIdentity.GetCurrent().Name. Looks like using the
later does not make all request using that impersonation.

From my understanding using, <identity impersonate="true"
userName="domain\username" password="password"/> in the webconfig file,
causes all request in my web service to use that impersonation. But
using,
<identity impersonate="true" /> doesn't. I don't want to store a username
and password in the webconfig file. I always want to pass the credentials
in. Finally the question: How can I use <identity impersonate="true" />
and
pass in the credentals and force all request to be called using that
impersonation?

Hope this makes sense.

Thanks



.



Relevant Pages

  • Re: ASPNET and Impersonation
    ... > not through any additional configuration using the ... > file (instead of being localized to the single Web Service ... > using Impersonation or changing the process identity, ...
    (microsoft.public.dotnet.security)
  • Re: ASPNET and Impersonation
    ... > not through any additional configuration using the ... > file (instead of being localized to the single Web Service ... > using Impersonation or changing the process identity, ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Credentials and authentication
    ... you can if you use basic authenication. ... turn on impersonation in web config, and set the credials in the ... and fill in the credentials in the web request. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Windows authentication for web service client??
    ... I have a web service that make a webDav request to Exchange. ... I have impersonation on but when I use the defaultCredentials in the web ... credentials have rights to make this request and I'm at my wits end trying ... >>> The ASPNET account is a local account, so the other machine or domain ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Can it work...? - ASP.NET Impersonation with Remoting
    ... I have an ASP.NET Web Page / Web Service that runs on IIS and uses ... Server expects a Principal token not a cheapo Impersonation token ... request it do the work (The Service will check the credentials and ...
    (microsoft.public.dotnet.framework.remoting)