Skip to content

Commit 3943e63

Browse files
authored
Merge pull request #2738 from matrix-org/revert-2737-revert-2033-travis/msc/whoami-device
TBD: MSC2033: Adding a device_id to /account/whoami
2 parents 6b64281 + 9080c5f commit 3943e63

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

proposals/2033-whoami-device-id.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Proposal to include device IDs in `/account/whoami`
2+
3+
There are some use cases (namely using
4+
[Pantalaimon with bots](https://github.com/matrix-org/pantalaimon/issues/14))
5+
which could benefit from knowing the `device_id` associated with a token.
6+
7+
8+
## Proposal
9+
10+
The `/account/whoami` endpoint receives an additional response field for the `device_id`
11+
associated with the access token. The field is optional because appservice users may not
12+
have a real device associated with them. Non-appservice users should always have a device
13+
associated with them.
14+
15+
Access tokens are already associated with at most 1 device, and devices are associated with
16+
exactly 1 access token. Because of this, we do not need to worry about multiple devices
17+
causing problems. For more information, see
18+
https://matrix.org/docs/spec/client_server/r0.4.0.html#relationship-between-access-tokens-and-devices
19+
20+
*Note*: Pantalaimon would likely require a `device_id` be returned and error requests
21+
otherwise. This should be considered expected behaviour by Pantalaimon in the MSC author's
22+
opinion.
23+
24+
25+
## Tradeoffs
26+
27+
We could introduce a `/device/whoami` endpoint, however that is a less superior option. Most
28+
calls to `/device/whoami` would additionally need to call `/account/whoami` to determine the
29+
user ID of the account. We had might as well bundle the two pieces of information into the
30+
same request.

0 commit comments

Comments
 (0)