Closed
Bug 1156405
Opened 10 years ago
Closed 10 years ago
Cache and use expired Token Server tokens when querying info/collections
Categories
(Firefox for iOS :: Firefox Accounts, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: nalexander, Assigned: nalexander)
References
Details
Attachments
(1 file)
Right now, Sync on Firefox iOS requests a fresh token server token every sync. This is strictly not necessary: to reduce authentication requests, we can use a cached-but-expired token to make an info/collections request. (Subsequent requests, if required, need a valid token.)
This ticket tracks caching and using an expired token as required.
Assignee | ||
Comment 1•10 years ago
|
||
rnewman: my plan for this is to surface the SyncAuthState directly to the Sync machine. The Sync auth state will expose an expired token on request, and also a valid token. The Account state machine will be advanced as necessary for both tokens. This inversion of control should allow an efficient authentication flow.
Comment 2•10 years ago
|
||
I *think* the Sync side of this is done; it requests an expired or not token:
public class func getInfoCollections(authState: SyncAuthState, prefs: Prefs) -> Deferred<Result<InfoCollections>> {
log.debug("Fetching info/collections in state machine.")
let token = authState.token(NSDate.now(), canBeExpired: true)
versus
public class func toReady(authState: SyncAuthState, prefs: Prefs) -> ReadyDeferred {
let token = authState.token(NSDate.now(), canBeExpired: false)
Indeed, we're already mostly ready to take a TokenSource when advancing, which is the next step when we think we do need to sync: see advanceWithToken in InitialWithExpiredTokenAndInfo.
Assignee | ||
Comment 3•10 years ago
|
||
rnewman: I see one comment, which I'm happy to address. Add others as needed.
I expect to morph remoteTimestamp into a local clock skew to have (more) accurate expired testing in a follow-up commit.
Updated•10 years ago
|
Attachment #8595030 -
Flags: review? → review+
Assignee | ||
Comment 4•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•