by mcherm · 10y ago · 0 comments
Just as if you were storing state on the server, it still requires a means of propagating the user's state to every server. But we only need to propagate a single ID once per session (at logout) instead of propagating all the session data to all the servers on every request.
Another approach is what I call the "subject epoch" pattern. The subject of a token (the "sub" JWT claim) is often something like a user ID. When an event occurs that requires all tokens for a given subject to be revoked, save that time stamp as the subject's "epoch". When processing JWTs, those issued before the subject's epoch must be considered invalid.
Is there a way around this? I like the idea of a revocation list, but this seems to be a pretty big concern.
If we used a different approach, then the same error (losing the data that's being synched) would result in losing all of the customer sessions.
JWTs generally contain an expiration timestamp.