Package Exports
- passport-vimeo-oauth2
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (passport-vimeo-oauth2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
passport-vimeo-oauth2
Passport strategy for authenticating with Vimeo using the OAuth 2.0 API.
Install
$ npm install passport-vimeo-oauth2Usage
Configure Strategy
The Vimeo authentication strategy authenticates users using a Vimeo
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 client ID, client secret, and callback URL.
passport.use(new VimeoStrategy({
clientID: CLIENT_ID,
clientSecret: CLIENT_SECRET
},
function(accessToken, refreshToken, profile, done) {
User.findOrCreate({ VimeoID: profile.id }, function (err, user) {
return done(err, user);
});
}
));Authenticate Requests
Use passport.authorize(), specifying the 'vimeo' strategy, to
authenticate requests.
For example, as route middleware in an Express application:
app.get('/auth/vimeo',
passport.authorize('vimeo'));
app.get('/auth/vimeo/callback',
passport.authorize('vimeo', { failureRedirect: '/login' }),
function(req, res) {
// Successful authentication, redirect home.
res.redirect('/');
});Thanks
License
Copyright (c) 2014 Michael Pearson