Currently we have two possibilities (which I know) to impersonate some account as a different user:
- First solution can be implemented in the following way:
it works, but adds a lot of effort for Administrators, they have to define each user in list of possible impersonators (unfortunately this approach doesn't support groups).
- Second approach is to get user session using SlingRepository.impersonateFroService:
Unfortunately, this requires to pass userId and password, that is usually impossible to get from programmatical point of view.
To make life easier, it would be nice if one of the following suggestion would be implemented:
- slingRepository.impersonateFromService(null, credentials, null); could start accepting credentials without password
- impersonators could be configured for group of users