Impersonate a membership user in ASP.NET Impersonate a membership user in ASP.NET asp.net asp.net

Impersonate a membership user in ASP.NET


Take a look at this sample on codeproject.com. I think it does what you're looking for.


I don't have the code we used to do this in front of me (assignment from a few years ago), but there are bits in the Membership API to sign someone in using code. I will not have access to the code until this weekend, unfortunately, or I could quickly share the bits and be done with this.

I do remember you had to get the user first, as a MembershipUser, using the Membership class. I am not sure, from this point, whether you had to validate against provider or what.We did use a custom provider, but I forget whether it was related to this solution.

Regardless, examine the security bits, focusing on membership and membershipUser.