-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSC2918: Refresh tokens #2918
MSC2918: Refresh tokens #2918
Conversation
Just pushed two changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few recent changes:
- d433e3b specify what error code should be used related to this)
- b320001 suggest what to do with refresh token revocation on use (this is what is implemented in Synapse)
- 87566c3 clarify that it also applies to ASes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty confortable with the current state of the MSC. The implementation in Synapse is pretty much done and working (matrix-org/synapse#9450) and in a working state in Hydrogen (element-hq/hydrogen-web#235).
MSC: matrix-org/matrix-spec-proposals#2918 Fixes element-hq/element-web#18698 Fixes element-hq/element-web#20648 **Requires matrix-org/matrix-js-sdk#2178 **Note**: There's a lot of logging in this PR. That is intentional to ensure that if/when something goes wrong we can chase the exact code path. It does not log any tokens - just where the code is going. Overall, it should be fairly low volume spam (and can be relaxed at a later date). ---- This approach uses indexeddb (through a mutex library) to manage which tab actually triggers the refresh, preventing issues where multiple tabs try to update the token. If multiple tabs update the token then the server might consider the account hacked and hard logout all the tokens. If for some reason the timer code gets it wrong, or the user has been offline for too long and the token can't be refreshed, they should be sent to a soft logout screen by the server. This will retain the user's encryption state - they simply need to reauthenticate to get an active access token again. This additionally contains a change to fix soft logout not working, per the issue links above. Of interest may be the IPC approach which was ultimately declined in favour of this change instead: #7803
FTR, I'm working on the spec PR for this |
Spec PR: matrix-org/matrix-spec#1056 |
merged! 🎉 |
I've added Element Web and iOS implementations of this MSC to the PR description. |
@anoadragon453 ftr, the web implementation was reverted: matrix-org/matrix-react-sdk#7821 |
Oh, thanks for letting me know! |
Rendered
Related: matrix-org/matrix-spec#410, matrix-org/matrix-spec#636
Implementations: synapse, hydrogen,
Element Web/Desktop(reverted), Element iOSFCP proposal: #2918 (comment)