Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Youtube strategy for passport
JavaScript
branch: master

Merge pull request #4 from ravenjohn/patch-1

Allow addition of other authorization parameter
latest commit 0bd2aad892
@jozzhart authored
Failed to load latest commit information.
lib/passport-youtube Allow addition of other authorization parameter
.gitignore clean up
.npmignore clean up
LICENSE 0.0.5
README.md Update readme
package.json

README.md

passport-youtube

Youtube strategy for passport

Unsupported

I'm not currently actively supporting this, but happy to take pull requests or hand-over to another contributor.

Install

$ npm install passport-youtube

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.

passport.use(new YoutubeStrategy({
    clientID: YOUTUBE_APP_ID,
    clientSecret: YOUTUBE_APP_SECRET,
    callbackURL: "http://localhost:3000/auth/youtube/callback"
  },
  function(accessToken, refreshToken, profile, done) {
    User.findOrCreate({ userId: profile.id }, function (err, user) {
      return done(err, user);
    });
  }
));
Something went wrong with that request. Please try again.