Hello,
I just tested this locally. If I authenticate as a system admin and then impersonate a domain admin, I can get the user's information. I can also get the results if I authenticate as a domain admin user.
System Admin -> Impersonate a Domain admin
userToGet = 'acquaintances.sbin.testing'
payload = {"email":f"{userToGet}"}
postUrl = f'{ascholz.uri}api/v1/settings/domain/get-user'
ascholz.authenticate()
ascholz.impersonate_domain('ascholz.io')
post_results_systemAdmin_impersoante = requests.post(url=postUrl, json=payload, headers=ascholz.HeaderImpersonate)
post_results_systemAdmin_impersoante # http 200
Domain admin
userToGet = 'acquaintances.sbin.testing'
payload = {"email":f"{userToGet}"}
postUrl = f'{ascholz.uri}api/v1/settings/domain/get-user'
ascholzDomain = API(u='admin@ascholz.io', p='admin')
post_results_domainAdmin = requests.post(url=postUrl, json=payload, headers=ascholzDomain.headers)
post_results_domainAdmin # http 200
Let me know if this helps. Thanks
~Tony
Tony Scholz
System/Network Administrator
SmarterTools Inc.
www.smartertools.com