Impersonate a membership user in ASP.NET

后端 未结 2 1717
野趣味
野趣味 2021-02-08 17:25

In a generic asp.net website with Membership, Roles and hashed passwords enabled, I would like to provide the administrators with im

2条回答
  •  悲&欢浪女
    2021-02-08 18:02

    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.

提交回复
热议问题