cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Android SDK auth access token malformed when Access Token use in Dropbox JS SDK

Android SDK auth access token malformed when Access Token use in Dropbox JS SDK

harunctgbd
Explorer | Level 3

Recently I have included Dropbox in my ionic 1 android application through Dropbox JavaScript SDK for user data backup. I have used inAppBrowser for the authentication process. Everything is working perfectly and 100+ user already using this feature.

After 100+ user I have applied for production request but it's declined reason for OAuth app authorization flow inside a web view, instead of the system browser.

For handling this situation I have made an ionic plugin for native authentication flow of Dropbox android SDK. I have developed & configure my plugin using Dropbox android SDK (https://www.dropbox.com/developers-v1/core/sdks/android) for getting access token. This part also working fine and I am getting access token successfully.

But problem is, when I am sending my Access Token to JS SDK (https://github.com/dropbox/dropbox-sdk-js) it's returning 400 response The given OAuth 2 access token is malformed

var dbx = new Dropbox({ accessToken: ACCESS_TOKEN });
dbx.usersGetCurrentAccount()
.then(function(response) {    
	console.log(response);
}).catch(function(error) {    
	console.error(error);
});

 In this situation what can I do? I can not figure out the solution

10 Replies 10

Greg-DB
Dropbox Staff

Thanks! I'll work on getting that environment working to try to reproduce this. (I can't make any promises though, as we don't officially support Cordova/Ionic.)

I'm looking through the code though, and I don't see where you actually construct the Dropbox JavaScript client object and call usersGetCurrentAccount, per your original comment. Can you add that? Given the rest of the investigation here, it certainly seems possible that that portion will be relevant (e.g., how you're transferring the token over, when/where you're loading and using the JavaScript library, etc.).

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    harunctgbd Explorer | Level 3
What do Dropbox user levels mean?