I am looking for the "correct" way to regularly poll Facebook to ensure the user's oauth token is still valid. I am using Facebook to validate the user's account into my own app. Their use of my app doesn't necessarily result in any Facebook graph calls, but I still need to know if the oauth token was invalidated since they logged into my app, eg. by a Facebook password change.
Facebook has a page explaining how to handle invalidations: https://developers.facebook.com/blog/post/2011/05/13/how-to--handle-expired-access-tokens/ They also have a /me URL that can be hit at any time to see if the token is currently valid. (eg. per Check if Ouath token is invalid) But what is the right pattern and frequency to poll beyond the user's initial login?
I am considering a solution like:
BAD: Check the oauth token's validity on every request to my app. (too heavy, slows down every request, probably makes facebook mad)
BETTER?: Check the oauth token's validity when the user makes a request to my app IF the oauth token hasn't been checked in more than X minutes
That last solution feels right, but I can't find any references to anyone else doing this.
Is this the best practice for polling oauth validity? Can anyone point to docs referring to this use case, or confirm you've solved this problem yourself?