EDIT
It looks like the code I posted on the Dropbox dev blog doesn't work (now?). You need to manually check whether the client is authenticated, since the callback from client.authenticate
is called no matter what.
I'll update the blog post. The fixed code should look like this:
// Try to complete OAuth flow.
client.authenticate({ interactive: false }, function (error) {
if (error) {
alert('Error: ' + error);
} else if (client.isAuthenticated()) { // <-- this line changed
doHelloWorld();
}
});
Original (wrong) answer
At first glance, the only difference I can spot between your code and mine (https://www.dropbox.com/developers/blog/71/writing-a-file-with-the-dropbox-javascript-sdk) is that you're specifying an app secret (when you shouldn't be).
If you remove that line, does your app work?
(BTW, I redacted the app secrets you posted, but they're still visible in the edit history. I'd recommend deleting those apps and creating new ones.)