You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
dbapiadmin
3 years agoHelpful | Level 5
BackEnd Process with C#
I have a back-end process (without UI) that uses the dropboxteamclient and I have to do a number of reporting, file management in team folders. However, the current API is to use everything with HTTP...
- 3 years ago
It's working I changed the sample code to
var http = new HttpListener();
http.Prefixes.Add("http://*:port/");
Greg-DB
3 years agoDropbox Staff
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.
Apps can still get long-term access by requesting "offline" access though, 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.
It is not possible to fully automate the OAuth process where the user chooses to authorize the app and the app then receives the resulting access token and optional refresh token. This needs to be done manually by the user at least once. If your app needs to maintain long-term access without the user manually re-authorizing it repeatedly, the app should request "offline" access so that it gets a refresh token. The refresh token doesn't expire and can be stored and used repeatedly to get new short-lived access tokens whenever needed, without the user manually reauthorizing the app.
You can find an example of processing the app authorization flow and 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). The SDK will handle the refresh process for you automatically as long as you supply the credentials as shown in the examples.
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 after the change you won't be able to create new long-lived access tokens.
While the change began on September 30th 2021, we're releasing it gradually, so you may not have seen your app(s) affected until now. Once it applies to your app, it would apply regardless of the "Access token expiration" setting for your app, and that setting may no longer be available for your app.
- dbapiadmin3 years agoHelpful | Level 5
I have tried the OAuth Basic flow but it seems that opens a local window and we have to authorize again. Is there something we can do so we don't have to open a browser window? This is an unattended server side application.
- Greg-DB3 years agoDropbox Staff
You only need to do the authorization flow in the browser once per user. You can then store and re-use the resulting refresh token without further manual action. Refresh tokens can be re-used repeatedly and don't expire automatically.
- dbapiadmin3 years agoHelpful | Level 5
Thanks, I'm trying the OAuthTest sample project that you guys provide, and it keeps saying that 127.0.0.1 port number is refused and not able to connect. Is there something else I need to do?
About Discuss Dropbox Developer & API
Make connections with other developers
795 PostsLatest Activity: 23 hours agoIf 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!