Author: dwahlin | Posted on: 10/13/2005 2:26:32 PM | Views : 275

 I've been using Win API calls for dynamically impersonating user accounts with V1.1 with no problems (see code below). I'm now running the exact same code with ASP.NET V2 and the call to the Win32 API LogonUser method is returning false instead of true (no error code reported...it's 0). I'm guessing that underneath the covers some privileges aren't available to successfully complete the call that were available in V1.1. I looked at some of the code access security files for V2 but haven't found what I'd need to change to make the call run properly. By changing the script mappings for my IIS (Win XP Pro) virtual directory back to V1.1 everything works fine without any changes to the code...as soon as I change them back to V2 it fails though on the LogonUser call (no error reported...just get back false from the call). I've added a SecurityPermissionAttribute assertion into the class that calls the Win32 APIs but it still doesn't work.  Anyone els ...

Go to the complete details ...