It is possible for a JWT application to act on behalf of another user
by leveraging the as-user header.
Preconditions
The application must be configured to perform actions as users in the Developer Console. In the Configuration tab of your app, in the Additional Configuration section, select Make API calls using the as-user header.
Additionally, the authenticated user needs to be a user with Admin permissions, meaning either an Admin or Co-Admin. See our guide on for more details.
as-user using SDKs
All of the support acting on behalf of a user using the
as-user header.
Limitations
- You cannot use the
user_idof a in theas-userheader. - When impersonating a managed user, access is limited to content owned or controlled by the enterprise. Content owned by external users cannot be accessed through the
as-userheader. - The
as-userheader cannot specify the same user ID as the authenticated user. If the specified user ID matches the current user, the request fails with a403 Forbiddenerror.