DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Sat, 28 Jul 2007 10:49:21 -0700,    posted on: microsoft.public.dotnet.framework.aspnet.security        back       

Thread Index
  1    Dave


Asynchronous Web Services calls with Impersonation   
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.GetCurrent() I could
run .Impersonate against it but I'm not sure how to send this Object
to the Web Service


Help!



Regards,



David Homer
Date:Sat, 28 Jul 2007 10:49:21 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us