Transfer files to dropbox from node js without browser based oauth authentication

后端 未结 2 553
春和景丽
春和景丽 2021-02-02 14:31

I am running a nodejs + express based api server from heroku and using the dropbox-js library. Here\'s what I\'d like to do:

  1. A user hits a specific api endpoint a
2条回答
  •  忘掉有多难
    2021-02-02 14:54

    Or you can just use the Implicit grant and get the oauth token.

            var client = new Dropbox.Client({
                key: "xxxxx",
                secret: "xxxxx",
                token:"asssdsadadsadasdasdasdasdaddadadadsdsa", //got from implicit grant
                sandbox:false
            });
    

    No need to get to the browser at all.This line is no longer required!

       client.authDriver(new Dropbox.AuthDriver.NodeServer(8191));
    

提交回复
热议问题