We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
Mark R.5
9 years agoHelpful | Level 5
API V2 .NET Checking for a valid access token
What is the recommended way to check whether a saved access token is valid or not (e.g. a user may have revoked access via the website)?
I guess I am looking for the equivalent of the old HasLinkedAccount method...
Access tokens can be revoked remotely at any time, so the only way to check if it's still valid is to make an API call. The GetCurrentAccountAsync method is a good one for that, as it doesn't have any side effects.
(By the way, I believe the old HasLinkedAccount method you referred to didn't actually do that, and only checked for the local existence of an access token.)
2 Replies
- Greg-DB9 years ago
Dropbox Community Moderator
Access tokens can be revoked remotely at any time, so the only way to check if it's still valid is to make an API call. The GetCurrentAccountAsync method is a good one for that, as it doesn't have any side effects.
(By the way, I believe the old HasLinkedAccount method you referred to didn't actually do that, and only checked for the local existence of an access token.)
- Mark R.59 years agoHelpful | Level 5Ok thanks. So if that method throws an exception I guess I know all is not well. Interesting about HasLinkedAccount, that could explain some occasional unusual behavior in my app.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,034 PostsLatest Activity: 18 minutes ago
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!