We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Omri1984
4 years agoExplorer | Level 4
Dropbox.Api.AuthException: expired_access_token/
Hi my company is using the sdk of dropbox.
an up until now alll was good suddenlty the automatically refresh token stop working and we are getting this error
Dropbox.Api.AuthException: ex...
Omri1984
4 years agoExplorer | Level 4
this is the one we are using
Dropbox.Api.4.7.0
and we are not doing refresh token at all , all manage automatically
can we have a quick session please
Greg-DB
Dropbox Community Moderator
4 years agoOmri1984 I can't offer API support via phone or a virtual meeting, but I can help here.
Здравко is correct, v4.7.0 of the Dropbox .NET SDK does not support refresh tokens. That was added in v5.0.0. You'll need to update to at least that version (or ideally the latest version, currently v6.30.0) for automatic refresh token support.
For reference, Dropbox is in the process of switching to only issuing short-lived access tokens (and optional refresh tokens) instead of long-lived access tokens. You can find more information on this migration here. Attempting to use an expired short-lived access token will result in this 'expired_access_token' error. The latest versions of the official SDKs can handle this for you automatically though, if you use "offline" access/refresh tokens.
Apps can get long-term access by requesting "offline" access, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the OAuth Guide and authorization documentation.
For the official Dropbox API v2 .NET SDK in C#, you can find an example of getting and using a refresh token in the OauthBasic example (non-PKCE, meant for server-side apps) as well as in the OAuthPKCE example (PKCE, meant for client-side apps). When you supply the DropboxClient with the necessary credentials, including the refresh token, as shown in those examples, the client will automatically perform the access token refresh for you.
For reference, while the creation of new long-lived access tokens is now deprecated, we don't currently have a plan to disable existing long-lived access tokens. (If that changes, we will of course announce that ahead of time.) That being the case, you can continue using existing long-lived access token(s) without interruption, if you have any. Also, note though that you won't be able to create new long-lived access tokens.
About Discuss Dropbox Developer & API
Make connections with other developers
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, Facebook or Instagram.
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!