matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.82k stars 2.13k forks source link

Rename user #12174

Open hex-m opened 2 years ago

hex-m commented 2 years ago

One of my users would like to change their Matrix ID (staying on the same server). I would like to support them.

I know about https://modular.im/tools/matrix-migration, but as the SSO (SAML)-Account stays the same, the two accounts won't be usable at the same time. Also I would prefer to make the process as painless as possible for the user.

An ideal solution would be an admin API call which:

  1. creates the new account
  2. points the external_id to the new account
  3. adds the new account to the same rooms (with the same permissions) than the old one
  4. associates the key backup with the new account

At the next login the user would be asked for the recovery key and have access to all rooms and messages like before.

An alternative solution could be to have the new account work like an alias for the first one. This would would mark the two accounts as "belonging to the same person" and thus other servers could treat them like they would be the same account.

There are discussions about server independent accounts and moving accounts between servers but this request seems smaller to me.

keywords: migrate account, change mxid, localpart

reivilibre commented 2 years ago

This is quite tricky but might be fixed by nomadic/dissociated identities (or whatever the code name is nowadays) as you've noticed.

However it's probably just as difficult as moving an account between servers: all the keys and permissions and so on would need to be transferred so they are valid for a different MXID (and so that other users/servers understand they're the same user!). Whether or not the server name changes during this process doesn't actually make much difference, from what I can tell.

Unfortunately a user's MXID is currently quite permanent and, as you've noticed, quite a nuisance to 'change'. This is something that's known and is going to get dealt with (it's practically a necessity for the peer-to-peer work), but I couldn't tell you that anything is coming very soon.

reivilibre commented 2 years ago

Note: the first two steps are already possible. Adding the new account to the same rooms is often possible (depending on permissions); promoting them to the same permissions is sometimes possible (usually only if you're the room admin). Associating key backup with the account is uncertain — the client might not know what to do about keys that aren't for the (new) MXID.

Solving this properly involves disocciated identities or else a bit of proper work (including client work) which could also support cross-server moves.

bkil commented 1 year ago

Related https://github.com/matrix-org/synapse/issues/8885

knurd75zid commented 1 year ago

Note: the first two steps are already possible.

I am desperate to do this. I managed to create new account, added them to the relevant rooms etc. No Problem. All by API.

Where I fail is, to permanently and definitively remove the external_id from the old, unwanted, to be deactivated accounts. That is:

I expected a new account, with the correct name to be crated and betting associated with the external ID.

Could you kindly point out what I am doing wrong? I use the 1.94 Synapse Version, updated 2 days ago.