如何使保管箱验证弹出窗口而不是重定向

How to make dropbox authenticate a popup instead of redirect

我正在使用 Dropbox JavaScript SDK 并对用户进行身份验证,以便获得 oauth 令牌。问题是,当使用 client.authenticate() 时,用户会被重定向到 Dropbox 而不是弹出窗口。如何将其更改为弹出窗口?

参见https://github.com/dropbox/dropbox-js/blob/stable/guides/builtin_drivers.md

client.authDriver(new Dropbox.AuthDriver.Popup({
    receiverUrl: "https://url.to/oauth_receiver.html"}));

和 运行 这个在你的 oauth_receiver.html:

Dropbox.AuthDriver.Popup.oauthReceiver();