ASP.NET Forms Authentication Custom Impersonation

Scenario:. In an e-commerce system, a support service user must be able to "impersonate" or "register" as a "specific client (from the administration website) so that he can support the client first hand - for example, when the Client is on the phone.

Additional clarification: There is no need to track the original authentication context. We just need to provide the "Login As" button, which will log into the system as a client if the support service user does not need to know the password.

Any ideas on how this scenario can be implemented using regular ASP.NET Forms authentication?

+6
forms-authentication
source share
2 answers

Maybee I don't exactly understand the script. But why not enable support as a user?

FormsAuthentication.SetAuthCookie("yourCustomersUserName"); 

Then the e-commerce system will have an updated β€œbasket” or something else that can help.

+3
source share

I managed to get this to work, assuming you have a user already registered, you can impersonate another user using the code below.

 FormsAuthentication.SignOut(); FormsAuthentication.SetAuthCookie("username", true ); 
+3
source share

All Articles