Project Description
This solution includes two libraries for implementing impersonation in your ASP.NET, .Net, VB6 or Classic ASP applications.

1.) Impersonation Class Library for any .Net based application. This was written against framework 3.5 but also should work with 2.0 & 1.1 since a bulk of the code is calling Windows API's.

2.) Com Visible Impersonation Class Library that can be called from Classic ASP & Visual Basic 6 applications.

Notes: In Asp.Net the benefit of this as opposed to impersonating in the web.config (for the whole page) is that you can isolate heightend permissions down to blocks of code or individual lines of code. It also lets you do things like open trusted database connections without having to have the whole page run as a proxy account (this comes in especially handy if you use ADOMD to connect to OLAP cubes on SQL Server Analysis Services which only accepted trusted connections, no SQL accounts).

This solution was written in Visual Basic using Visual Studio 2008. To include in C# either compile this library and add a reference to the .DLL or port the code which is fairly small. There are other C# solutions available on the web and on code plex so I won't recreate the wheel (I'll find links in the future for those who want to keep their source in C# and not bother with porting).

Last edited Feb 18, 2008 at 8:41 PM by bpell, version 2