npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

passport-dropbox-auth

v1.0.6

Published

Passport strategy for Dropbox

Downloads

4

Readme

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": "[email protected]",
    "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": "[email protected]",
    "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"
}