Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
makrand kulkarni
4 years agoExplorer | Level 4
How to get refresh token without User interaction
Hello Team,
As Drop Box Access Token is invalid after 4 hr. I want to implement refresh token mechanism at Backend Java code without User Interaction i.e fully automated. so I have a requirement to...
Greg-DB
Dropbox Community Moderator
4 years agoIt is not possible to get a refresh using an app key and access token programmatically. You can only get a refresh token using the OAuth app authorization flow.
Likewise, 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 examples of this functionality in the Dropbox API v2 Java SDK here.
makrand kulkarni
4 years agoExplorer | Level 4
Thanks, I have one more query, As Per Example Given, Auth Code needs to be Enter manually by User to get Access and Refresh Token,
For A Company Clients this could not be Implemented as there are multiple users which will use our application.
1 Is there any other solution where Auth code can be taken Internally by Application ?
2. In which Parameter Auth Code can be taken in response of redirect-uri ?
It will be great help on this .
- Здравко4 years agoLegendary | Level 20
makrand kulkarni wrote:...
1 Is there any other solution where Auth code can be taken Internally by Application ?
...
As you already guessed, Yes, using redirect URI.
makrand kulkarni wrote:...
2. In which Parameter Auth Code can be taken in response of redirect-uri ?
...
You can take a look on a web example to take idea from or on general authorization doc.
Good luck.
- Greg-DB4 years ago
Dropbox Community Moderator
makrand kulkarni Здравко is correct. While the authorization process needs to be processed manually once per user, you can use a redirect URI to make that process easier. Please refer to the resources that Здравко linked to.
- makrand kulkarni4 years agoExplorer | Level 4
- Здравко4 years agoLegendary | Level 20
While using SDK, the care for details is usually SDKs code's task, not to the code where SDK features are called from. Though, for all possible parameters in redirect URI you can take a look on /oauth2/authorize, in RETURNS section.
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!