|
| 1 | +# Soft Remote Logout Proposal |
| 2 | + |
| 3 | +## Motivation |
| 4 | + |
| 5 | +Currently when a user logs out of riot, the app will destroy things like |
| 6 | +encryption keys. If the logout was done by the user in local app then it will |
| 7 | +have first prompted the user to export the encryption keys. However, when the |
| 8 | +app is logged out remotely (i.e. it received a 401 from the server) there is no |
| 9 | +opportunity to ask the user to backup the keys, resulting in those keys being |
| 10 | +lost. |
| 11 | + |
| 12 | +While this behaviour is useful in many circumstances, e.g. remote logging out a |
| 13 | +stolen/lost device, it also means that the server shouldn't automatically |
| 14 | +log out devices, to avoid users losing encryption keys. |
| 15 | + |
| 16 | + |
| 17 | +## Proposal |
| 18 | + |
| 19 | +A new parameter is added to the JSON body of 401 responses, called |
| 20 | +`soft_logout`. This is a boolean flag (defaulting to `false`) that signals to |
| 21 | +the client whether it should keep local data and simply prompt to reauth (when |
| 22 | +`true`) or to destroy the current data like it does today (when `false`). |
| 23 | + |
| 24 | +The major disadvantage with this approach is that once the client is logged |
| 25 | +out, the user can no longer remotely cause the client to destroy the local |
| 26 | +data. However, this is not substantially different from today where the app has |
| 27 | +to be opened to receive remote logout requests (via 401), as it allows |
| 28 | +attackers to get at encryption keys even after remote logout if they simply |
| 29 | +avoid opening the app. |
| 30 | + |
| 31 | + |
| 32 | +### Example Client UX |
| 33 | + |
| 34 | +When handling a soft logout the client could show a "re-login" dialogue, rather |
| 35 | +than back to the default logged out screen. This new dialogue would then have |
| 36 | +several options including logging out, exporting keys and logging out fully. |
| 37 | + |
| 38 | + |
| 39 | +## Alternatives |
| 40 | + |
| 41 | +One alternative is to force the user to enter a password for backing up keys |
| 42 | +when they enter the app, and then have the app keep secure backups of they |
| 43 | +keys. This then means its safer to not delete the secure backups when the app |
| 44 | +is logged out remotely. |
| 45 | + |
0 commit comments