-
Notifications
You must be signed in to change notification settings - Fork 533
Closed
matrix-org/matrix-ios-sdk
#1319Labels
T-EnhancementNew features, changes in functionality, performance boosts, user-facing improvementsNew features, changes in functionality, performance boosts, user-facing improvements
Description
Add support for refresh token:
https://github.com/matrix-org/matrix-doc/blob/main/proposals/2918-refreshtokens.md
matrix-org/synapse#11427
Implementation Highlights:
- We add the
refresh_tokenparameter to login/register requests to receive arefresh_token(used to request new access tokens) and anaccess_tokenin addition to aexpires_in_msinterval (to estimate client side when the token expires). - We should handle the cases where
refresh_tokenis empty (server may not support refresh tokens or not have it enabled), expires_in_ms is empty ( the access token does not expire). - There is a
/refreshendpoint where therefresh_tokencan be provided to gain a new access token. - Refresh tokens rotate, each time we call the
refreshendpoint we also get a newrefresh_token. Therefore we must be careful around the time of each refresh that if we have multiple concurrent requests we don't make multiple refresh requests or mishandle the newrefresh_token. - We can preemptively refresh the token shortly before it expires to minimise any disruption to the user(waiting on the refresh request before a user request can be made). On iOS the server timeout we set on
syncrequests is 30s, so sometime like 60s seems reasonable for preemptive expiry.
Rollout plan:
- Distribute an alpha build(people have to explicitly download and can run side-by-side) to an initial set of internal users to test.
- Enable for all testflight beta users and monitor for a period of time.
- Ship to prod and monitor.
Metadata
Metadata
Assignees
Labels
T-EnhancementNew features, changes in functionality, performance boosts, user-facing improvementsNew features, changes in functionality, performance boosts, user-facing improvements