cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API V2 .NET Checking for a valid access token

API V2 .NET Checking for a valid access token

Mark R.5
Helpful | Level 5
Go to solution

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...

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

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.)

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

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.5
Helpful | Level 5
Go to solution
Ok 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.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Mark R.5 Helpful | Level 5
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?