I have been using some Java code to run API calls to do integrated testing on webservices in our SFDC org. So far, I used to log in through the browser and get my admin sessionId, then copy / paste it into the Java program, then log in as a non-admin user and get their sessionId and copy / paste that as well.
I have been trying to use the SOAP API to get both these sessionIds, and can easily get my admin sessionId, but I haven't been able to find a way to replicate the "Login as another user" functionality on the SFDC UI which lets you log in as another user without knowing their password.
Is there any way to do this? I generally use my admin creds to create a new user using an API and want to log in as that user immediately to get their sessionId.
Any pointers will be greatly appreciated...