简体   繁体   中英

Dropbox API V2 authenticateWithCordova not working as expected

I have Cordova application in which have implemented the Dropbox functionality using javascript SDK. I use authenticateWithCordova method to authenticate the users.

The authenticateWithCordova method works fine for the first time and successfully returns the access token. The access token can then be subsequently used for other operations such as upload, download etc.

I am using as below URI as redirect URI,

https://www.dropbox.com/1/oauth2/redirect_receiver

When I call authenticateWithCordova method for the second time it shows a login screen for second and returns to the app. I want the users to be able to use different Dropbox accounts.Need Some Help!

If the user signed in to the browser has already authorized your app, they may be automatically redirected back to your app instead of having to provide explicit authorization again.

The API offers the ability to control that using the force_reapprove parameter on /oauth2/authorize , though that's unfortunately not currently implemented in the API v2 JavaScript SDK itself, eg, for the authenticateWithCordova method. We'll consider it a feature request for implementing that in the SDK, but I can't promise if/when that would be done.

If you need a workaround, you can direct the user to https://www.dropbox.com/logout to log out of the account first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM