Git Product home page Git Product logo

othw's Introduction

Note: The samples in this repo use the /1/account/info endpoint in Dropbox API v1, which has been retired. Learn more. The OAuth 2 implementations can still be used for Dropbox API v2 though.

Dropbox and OAuth 2 the Hard Way

This project shows, in a variety of languages, how to authenticate a user and call the Dropbox API without using existing OAuth or Dropbox libraries.

Code is provided for the following languages:

To run the samples, you'll need to create a Dropbox API app and put your app key and secret into the code. You'll also need to set up the right OAuth 2 callback URL (http://127.0.0.1:5000/callback for most samples, http://localhost:5000/callback for C# and http://127.0.0.1:5000 for JavaScript).

FAQ

Why?

There are lots of libraries for using the Dropbox Core API, but some languages don't have a library, and libraries don't always cover every option of every API method. Fortunately, the API is pretty simple, and OAuth 2 (which is used for authentication) is also pretty simple. By reading through these examples, a developer familiar with basic HTTP APIs should be able to write their own code for interacting with the Dropbox API without having to rely on an existing library.

It's also kind of fun and instructive to read and write the same app in multiple programming languages.

Your code sucks.

Good question! I'm not an expert in most of these languages—for example, this was my first time writing Go—so it's quite likely that I got some code wrong or failed to follow some language idioms. Please send me a pull request if you have suggestions for how to improve the code.

What about language X?

Let me know by opening an issue if there's another language you'd like to see a sample for. Better yet, write it yourself and send a pull request!

othw's People

Contributors

greg-db avatar smarx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

othw's Issues

C language

would be nice to have one example for C, using for example libcurl, and some base64 library
as all examples posted there either have cryptic stuff like regex, or uses classes and other OOP stuff, so a clean C version would be very useful.

JavaScript not work

i had tried JavaScript ,
replace mykey
upload file to server
open the page in browser
but nothing happning, it says "Illegal return statement" on line no 39 index.html page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.