You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

passport-youtube-v3

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-youtube-v3

Youtube v3 API OAuth2 authentication strategy for Passport. Based on the passport-youtube module

2.1.0
latest
Source
npmnpm
Version published
Weekly downloads
893
12.9%
Maintainers
1
Weekly downloads
 
Created
Source

passport-youtube-v3

Youtube API v3 strategy for passport

Install

$ npm install passport-youtube-v3

Usage

Configure Strategy

The Youtube authentication strategy authenticates users using a youtube account and OAuth 2.0 tokens. The strategy requires a verify callback, which accepts these credentials and calls done providing a user, as well as options specifying a app ID, app secret, and callback URL.

See this doc for information about youtube scopes.


var YoutubeV3Strategy = require('passport-youtube-v3').Strategy


passport.use(new YoutubeV3Strategy({
    clientID: YOUTUBE_APP_ID,
    clientSecret: YOUTUBE_APP_SECRET,
    callbackURL: "http://localhost:3000/auth/youtube/callback",
    scope: ['https://www.googleapis.com/auth/youtube.readonly']
  },
  function(accessToken, refreshToken, profile, done) {
    User.findOrCreate({ userId: profile.id }, function (err, user) {
      return done(err, user);
    });
  }
));

Keywords

passport

FAQs

Package last updated on 02 Jul 2017

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