Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Asynchronous Web Services calls with Impersonation

Reply
Thread Tools

Asynchronous Web Services calls with Impersonation

 
 
Dave
Guest
Posts: n/a
 
      07-28-2007
Hello,

I have a problem with Impersonation with ASPX pages running with
Impersonation that call Web Services Asynchonously that the
Impersonated credentials are not passed to the Web Service when called
with the Begin... method, however they are when the Web Service is
called normally.

Microsoft .NET 2, Visual Studio 2005 Pro

-- SAMPLE ASPX Page --
Dim oService As New samplews.SampleService
oService.Credentials =
System.Net.CredentialCache.DefaultCredentials
oService.BeginWhoAmI(AddressOf callback, Nothing)


-- SNIPPET FROM THE SAMPLE WEB SERVICE --
<WebMethod()> _
Public Sub WhoAmI()
Dim oSR As New System.IO.StreamWriter("c:\temp
\wswhoami.txt", True)
oSR.WriteLine(My.User.Name)
oSR.Close()
End Sub


The subroutine - when run on Windows XP reports back as
COMPUTERNAME\ASPNET.


I can work around the problem by editing the ASPNET.CONFIG file,
however I don't like this idea as this will effect all applications
and the application I develop may well have to run alongside other Web
Applications (I got the idea to try this from
http://www.leastprivilege.com/WhatIsAspnetconfig.aspx)


<configuration>
<runtime>
<alwaysFlowImpersonationPolicy enabled="true"/>
<legacyImpersonationPolicy enabled="false"/>
</runtime>
</configuration>


Is there another way to pass my current credentials to the Web Service
when run Asyncronously? If I could send the Web Service my
System.Security.Principal.WindowsIdentity.GetCurre nt() I could
run .Impersonate against it but I'm not sure how to send this Object
to the Web Service


Help!



Regards,



David Homer

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Blocking problem/bug with enableSession=true and asynchronous web service calls? Jonathan Trevor ASP .Net 6 11-05-2010 04:18 PM
Asynchronous Web Services calls with Impersonation Dave ASP .Net Web Services 0 07-28-2007 05:49 PM
ASP.Net with Asynchronous Web Service calls =?Utf-8?B?VHJvdHNreQ==?= ASP .Net 7 05-03-2004 07:41 PM
Impersonation not working with Asynchronous calls Jason Elliott ASP .Net Security 0 12-11-2003 03:20 PM
Asynchronous Web Service Calls with asp.net??? zg_yuan ASP .Net 0 08-25-2003 05:04 PM



Advertisments