Arik Kfir
12/15/2025, 6:15 PM[E013009] Internal server error [Status-Code:404]
tokenString, err := h.dc.Management.JWT().Impersonate(
ctx,
callerID, // <- passing access key ID here
targetUser, // <- tried both user ID as well as user's login ID (Email)
false, // <- validateConcent=false (btw you have a typo here...)
nil, // <- customClaims set to nil
orgID, // <- tenant ID where the user has a "Member" role; access key has "Impersonate" permission (tried globally and in same tenant)
300, // <- 5min
)
What am I doing wrong? Perhaps access keys cannot impersonate?Chris Carper
12/15/2025, 8:58 PMuser_id passed starting with a K, which indicates a access/mgmt key.
You need to have a legitimate user with the impersonation right associated with it.Arik Kfir
12/15/2025, 9:03 PMImpersonate permission).
Would be great if that was mentioned in the docs (unless I missed it...)
I eventually landed on just using another user for the impersonation.
For what it's worth, we're using this so microservice A working in the background, runs operation on behalf of user X... so our way to "scope" the operation is to make sure it runs with user X's permissions - by impersonating it.
If there's a better way to do this, I'd love to hear about it.Chris Carper
12/15/2025, 9:10 PMKevin Gao
12/15/2025, 9:53 PMArik Kfir
12/15/2025, 11:59 PM