Externally impersonate a user

We have an admin app that allows our reps to impersonate a customer user into our customer app. Since we are moving our customer app authentication to KeyCloak, I also need to replicate the same impersonation functionality in our admin app. I managed to get impersonation working from the KeyCloak Admin Console. But when I try to add the same impersonation logic into our admin app using keycloak admin client, it will go to the login screen instead even though I do see a session is created from KeyCloak Admin Console. What do I need to do in order to get impersonation working from our admin app? The best approach would be impersonate a user directly into the customer app from admin app instead of going to the KeyCloak Admin Console.