简体   繁体   English

Dropbox API V2 authenticateWithCordova无法正常工作

[英]Dropbox API V2 authenticateWithCordova not working as expected

I have Cordova application in which have implemented the Dropbox functionality using javascript SDK. 我有Cordova应用程序,其中已使用javascript SDK实现了Dropbox功能。 I use authenticateWithCordova method to authenticate the users. 我使用authenticateWithCordova方法来验证用户。

The authenticateWithCordova method works fine for the first time and successfully returns the access token. authenticateWithCordova方法首次可以正常运行,并成功返回访问令牌。 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, 我正在使用以下URI作为重定向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. 当我第二次调用authenticateWithCordova方法时,它将显示登录屏幕,并返回到应用程序。 I want the users to be able to use different Dropbox accounts.Need Some Help! 我希望用户能够使用其他Dropbox帐户。需要一些帮助!

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. 该API提供了使用/ oauth2 / authorize上的force_reapprove参数进行控制的功能,但是很遗憾,API v2 JavaScript SDK本身目前尚未实现该参数,例如authenticateWithCordova方法。 We'll consider it a feature request for implementing that in the SDK, but I can't promise if/when that would be done. 我们将其视为在SDK中实现该功能的功能要求,但是我无法保证是否/何时能够实现。

If you need a workaround, you can direct the user to https://www.dropbox.com/logout to log out of the account first. 如果需要解决方法,可以将用户定向到https://www.dropbox.com/logout,以首先注销该帐户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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