Fixing an issue with token expiration timestamp on persist/restore. #6

wants to merge 1 commit into

2 participants


I ran into an issue when restoring an access token created during a previous run of my app. Basically whenever the token was restored it thought it would expire 'one hour from now' instead of 'one hour from my initial creation date' - if the app was shut down for over an hour the token would expire but the app still thought it was good. This commit fixes this by storing the absolute expiration time.

(For reference, is the related ticket for the app (actually plugin for an app) in question)

@nparry nparry Persist token expirations with absolute times instead of relative.
When storing a request or access token, persist the token expiration
time with an absolute timestamp. By doing so an application can
accurately determine if a token is still valid even if it is shutdown
and restarted after the token expires.  Previously a relative timestamp
was used, which meant a token restored from the persistent store always
claimed to be valid even if it wasn't.

Nice catch there! We just revamped our SDK with a whole new OAuth1.0a authentication flow using a UIWebview. Thank you for your contribution, we really appreciate it.

@michaelchum michaelchum closed this Sep 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment