ejang
ejang

Reputation: 4062

node.js dropbox OAuth

I'm having some trouble understanding the Dropbox JS api for node.js

after I create an authDriver, how do I route my client to a dropbox access dialog? Suppose they get a route '/applogin' that my express app handles, how do I pass the client to dropbox?

Thanks!

    var Dropbox = require("dropbox");
    var client = new Dropbox.client({
        key: "mykey", secret: "mysecret", sandbox: true
    });
    client.authDriver(new Dropbox.Drivers.NodeServer(8081));
//what comes next?

Upvotes: 1

Views: 766

Answers (1)

dark_ruby
dark_ruby

Reputation: 7874

After setting up an OAuth driver, authenticating the user is one method call away.

client.authenticate(function(error, client) {
  if (error) {
    return showError(error);
  }
  doSomethingCool(client);
});

Upvotes: 2

Related Questions