Login as functionality on the cloud

In the past we developed a functionality that gave administrators the option to login as a specified user without knowing their credentials. In the cloud this functionality does not work anymore because the instances are connected to the identity connect services. Does anyone know an customization that can provide us with the same functionality? The on premise version of the customization works by changing the global current_user and some session variables.