Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
bffy_smmmers
4 years agoHelpful | Level 5
dbx.auth not working / getAccessTokenFromCode giving 400 response?
I'm trying to access the `getAccessTokenFromCode` method and I keep receiving a 400 error. On top of that, I can't seem to write the code and get it to work in the way it's written in the Auth ex...
- 4 years ago
I'm not sure I follow your message, but you should specify it in both places. The /oauth2/authorize page redirect_uri parameter specifies where to send the user after they authorize the app, and the 'redirectUri' you pass to 'getAccessTokenFromCode' is just a string sent up in a /oauth2/token API call to verify that it matches.
Greg-DB
Dropbox Community Moderator
4 years agoIf you're signed in to an account that has already authorized the app, you may not be explicitly asked to authorize it again, and may instead just be redirected through the flow automatically. Check out the 'force_reapprove' parameter on /oauth2/authorize.
bffy_smmmers
4 years agoHelpful | Level 5
Also, Greg-DB im using the JavaScript SDK. I dont see how to inject forceReapprove/force_reapprove with the current methods im using on node backend (getAuthenticationUrl, getAccessTokenFromCode).
- Greg-DB4 years ago
Dropbox Community Moderator
That's correct, that parameter isn't currently implemented in the Dropbox JavaScript SDK, but I'll be sure to pass this along as a feature request. You can add it to the /oauth2/authorize URL in your app's own code though, by modifying the URL returned by getAuthenticationUrl.
- bffy_smmmers4 years agoHelpful | Level 5
Greg-DB Would you be able to expand on how that exactly gets done? Thanks!
- Greg-DB4 years ago
Dropbox Community Moderator
For example, where authUrl is the URL you got from getAuthenticationUrl, you can modify it like this:
var url = new URL(authUrl); var urlParams = new URLSearchParams(url.search); urlParams.set('force_reapprove', 'true'); url.search = urlParams; console.log(url.href);
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!