Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth Support: Dropbox #12

Open
alarner opened this issue Mar 22, 2016 · 5 comments
Open

OAuth Support: Dropbox #12

alarner opened this issue Mar 22, 2016 · 5 comments

Comments

@alarner
Copy link
Owner

alarner commented Mar 22, 2016

No description provided.

@addykim
Copy link

addykim commented Oct 12, 2016

I think I'd like to try tackling this. Could you give some information about what this issue is aiming to do?

@alarner
Copy link
Owner Author

alarner commented Oct 12, 2016

Hey @addykim I'm glad you're interested in tackling this issue! Here's a little bit more info on what's needed:

Perk's user authentication system is built on top of Passport, which has many different adapters for login using third party providers. The problem is that once a user authenticates with a third party provider (eg. Facebook or Twitter) the data that is returned by that provider is not in a standardized format. To deal with this problem Perk has adapters to take the data that the provider returns and standardize it. There are already four providers that do this for Facebook, GitHub, Google and Trello. This issue would involve creating a fifth to handle the Data returned by Dropbox.

To get started you will want to:

  1. Create developer account with Dropbox and register API keys. They should give you a client id and a client secret or something along those lines.
  2. Add a new section to config/auth.js that mimics one of the existing providers (don't use Trello, theirs is a bit weird, but any of the others are fine). Fill in your api keys there.
  3. Create a new adapter for dropbox in the adapters directory. The adapter is mostly a function that takes four arguments (accessToken, refreshToken, profile, and a callback). You will need to inspect the structure and contents of the profile argument and call the callback argument with an object that contains the dropbox user id, first name, last name and email of the user who logged in. This info should be available within the profile object. I would start by console.log'ing the contents of profile to see what it looks like. You can also model your adapter after one of the existing ones (again avoid the Trello one, but the others are fair game).
  4. To test it out you can boot up the perk server using npm run dev and then go to http://localhost:3000/auth/dropbox/login to initiate the login flow. Upon successfully logging in your adapter should be automatically called with the profile information.

If you run into any snags I'm happy to help out.

@iifeoluwa
Copy link
Contributor

Is this still available? I'd like to take this if no one is working on it.

@alarner
Copy link
Owner Author

alarner commented Feb 18, 2017

@addykim are you still working on this? If not do you mind if @iifeoluwa takes it over?

@addykim
Copy link

addykim commented Feb 20, 2017

I got caught up in other things and did not make progress. @iifeoluwa go for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants