pipacs / o2

OAuth 2.0 for Qt
BSD 2-Clause "Simplified" License
317 stars 147 forks source link

Store Facebook expiry token as returned by the service #18

Closed mandeepsandhu closed 11 years ago

mandeepsandhu commented 11 years ago

Facebook returns 2 kinds of tokens depending on what endpoint we are talking to:

  1. Short-lived tokens: Tokens used in client-server OAuth, have a short expiry time of 2 hours
  2. Long-lived tokens: Tokens used in server-server OAuth, have a longer expiry time of 60 days

Previously we were storing a hard-coded value of 2 hrs for it as there was some confusion regarding these values. But now we'll store whatever value the service returns.

Also, Facebook doesn't follow the OAuth2 RFC and returns a differently named expiry token - expires, so we'll use this special name in the O2Facebook class.