How to implement Impersonate (superuser impersonate another user)

Hello Forum

Our customer wants to have an impersonate function. So, if a staff member belongs to the hosting organsiation, and have a role, lets call it impersonate, this user should be able to log in and act as an end user customer.

So, after search the forum and docs no hits on “impersonate”.

So-my question are:

  • Is there some standard logic for this feature
  • If not, how would we solve it? Glancing at the forumtopic Login an account without password . But first, we need to make sure that the impersonateUser log in and check the correct authority level, secondly, the user need to pick the person he/she would “act as”, third, being able to log in as that user and “populate the cart etc”

Any ideas here?

Thanks.

Litium version: 7

  • There is no standard feature supporting this (as far as I know and if there would be someone else will reply) .
  • I guess one way could be to have a relational table that connects the actuall end user to the staff user with systemIds and then build the rest of the logics on that and override the login functionality.

Hi,
Has there been any progress regarding this question in the later Litium releases? I’m facing the same challenges but for Litium 8, StorefrontAPI and the React Accelerator.
In case there is no standard solution in Litium, has anyone implemented this earlier in Litium and if so, how did you solve it?
Thanks!

In the .NET API, you can use the Litium.Security.SecurityContextService.ActAs method to impersonate a user. However, the Storefront API does not have any endpoints for user impersonation. Please consider submitting this as a suggestion on ideas.litium.com.

Thanks. Will do!