ちょっと未来

ちょっと未来を感じさせるガジェットやアプリ、そして作ったものについて書きます

JavaScriptのDropbox APIで認証エラー

JavaScriptDropbox APIを使った機能で、認証がうまくいかなくなった件。 前は同じコードで上手くいってたのに、

Error: Dropbox API error 403 from GET https://api.dropbox.com/1/metadata/auto/?client_id=XXXXXXXXXX&include_deleted=false&list=true :: {"error": "Parameter not found: oauth_token"}

とか出ます。

結果的に認証のところのinteractiveオプションをtrueにしたら直りました。

    _client.authenticate({ interactive: true }, function (error) {
        if (error) {
            alert('Error: ' + error);
        } else {
            successCallback();
        }
    });

ドキュメントをみたところ

if false, the authentication process will stop and call the callback whenever it would have to wait for an authorization; true by default; this is useful for determining if the authDriver has cached credentials available

とのこと。 はて?trueにしといたほうが緩めな気配はするが。。どういうことだろう。