Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

passport-dropbox-auth

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-dropbox-auth

Passport strategy for Dropbox

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

CircleCI

passport-dropbox-auth

Simple Drobpox strategy for passport that supports both personal Dropbox and Dropbox for Business (utilizing the Docker API for user information).

Installation

npm install passport-dropbox-auth

Usage

Aside from the standard required fields, this module allows to optionally have passport include the express request object into the verification function (through the first variable)

Parameters:

  • clientID - Dropbox API Key
  • clientSecret - Dropbox API Secret
  • callbackURL - Oauth2 callback url (must match the callback in your Docker app)

Optional Parameters

  • passReqToCallback - boolean to tell passport to send the request in the first parameter of the verification callback. Defaults to false

Examples

With request

const DropboxStrategy = require('passport-dropbox-auth').Strategy;
const strategy = new DropboxStrategy(
{
    clientID: '<clientid>',
    clientSecret: '<clientSecret>',
    callbackURL: '<callbackURL>,
    passReqToCallback: true
},
async (request, accessToken, refreshToken, profile, done) => {
    done(null, <userId>);
}

Without request

const DropboxStrategy = require('passport-dropbox-auth').Strategy;
const strategy = new DropboxStrategy(
{
    clientID: '<clientid>',
    clientSecret: '<clientSecret>',
    callbackURL: '<callbackURL>,
    passReqToCallback: false //or omit this entirely
},
async (accessToken, refreshToken, profile, done) => {
    done(null, <userId>);
}

Profile Responses

Docker for Business

{
    "account_id": "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc",
    "name": {
        "given_name": "Franz",
        "surname": "Ferdinand",
        "familiar_name": "Franz",
        "display_name": "Franz Ferdinand (Personal)",
        "abbreviated_name": "FF"
    },
    "email": "franz@dropbox.com",
    "email_verified": true,
    "disabled": false,
    "locale": "en",
    "referral_link": "https://db.tt/ZITNuhtI",
    "is_paired": true,
    "account_type": {
        ".tag": "business"
    },
    "root_info": {
        ".tag": "user",
        "root_namespace_id": "3235641",
        "home_namespace_id": "3235641"
    },
    "country": "US",
    "team": {
        "id": "dbtid:AAFdgehTzw7WlXhZJsbGCLePe8RvQGYDr-I",
        "name": "Acme, Inc.",
        "sharing_policies": {
            "shared_folder_member_policy": {
                ".tag": "team"
            },
            "shared_folder_join_policy": {
                ".tag": "from_anyone"
            },
            "shared_link_create_policy": {
                ".tag": "team_only"
            }
        },
        "office_addin_policy": {
            ".tag": "disabled"
        }
    },
    "team_member_id": "dbmid:AAHhy7WsR0x-u4ZCqiDl5Fz5zvuL3kmspwU"
}

Docker Personal

{
    "account_id": "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc",
    "name": {
        "given_name": "Franz",
        "surname": "Ferdinand",
        "familiar_name": "Franz",
        "display_name": "Franz Ferdinand (Personal)",
        "abbreviated_name": "FF"
    },
    "email": "franz@gmail.com",
    "email_verified": false,
    "disabled": false,
    "locale": "en",
    "referral_link": "https://db.tt/ZITNuhtI",
    "is_paired": false,
    "account_type": {
        ".tag": "basic"
    },
    "root_info": {
        ".tag": "user",
        "root_namespace_id": "3235641",
        "home_namespace_id": "3235641"
    },
    "profile_photo_url": "https://dl-web.dropbox.com/account_photo/get/dbaphid%3AAAHWGmIXV3sUuOmBfTz0wPsiqHUpBWvv3ZA?vers=1556069330102\u0026size=128x128",
    "country": "US"
}

Keywords

FAQs

Package last updated on 29 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc