element-hq / element-hq/synapse
Allow specifying device ID to User Login Admin API
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
Being able to specify the device ID when using the [User Login Admin API](https://element-hq.github.io/synapse/latest/admin_api/user_admin_api.html) when logging in to a user's account is beneficial for several reasons:
* It allows the user to identify admin tooling based on its device ID.
* It allows admin tooling to log in to the same device ID repeatedly (i.e. to ensure E2EE continuity between sessions).
Currently the User Login Admin API specifically *does not* create a device:
> This API does _not_ generate a new device for the user, and so will not appear their `/devices` list, and in general the target user should not be able to tell they have been logged in as.
This is useful for Trust & Safety teams in order to allow them to log in as a user and execute requests without alerting the user to what's going on.
### Proposal
A `device_id` body field is added to the [User Login Admin API](https://element-hq.github.io/synapse/latest/admin_api/user_admin_api.html), for which the value is a string specifying the new device's ID.
By default, if the field is not present, a device is not created (as is the case today). If the field is present, then a device is created.
---
Note: the behaviour of not creating a device is marked as [deprecated](https://github.com/element-hq/synapse/blob/24c4d82aeb1bd5ac15cc0614e243595404fb2009/synapse/handlers/auth.py#L980-L981) in the codebase.
Contributor guide
Assessment
This issue has not been assessed yet.