pw

passport-wrike

Wrike authentication strategy for Passport and Node.js.

Showing:

Popularity

Downloads/wk

2

GitHub Stars

1

Maintenance

Last Commit

6yrs ago

Contributors

0

Package

Dependencies

1

Size (min+gzip)

8.0KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Passport-Wrike

Passport strategy for authenticating with Wrike using the OAuth 2.0 API.

Install

$ npm install passport-wrike

Usage

Configure Strategy

The Wrike authentication strategy authenticates users using a Wrike 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 WrikeStrategy({
    clientID: CLIENT_ID,
    clientSecret: CLIENT_SECRET,
    callbackURL: "/auth/wrike/callback"
  },
  function(accessToken, refreshToken, profile, done) {
    User.findOrCreate({ 'wrike.id': profile.id }, function (err, user) {
      return done(err, user);
    });
  }
));

Authenticate Requests

Use passport.authorize(), specifying the 'Wrike' strategy, to authenticate requests.

For example, as route middleware in an Express application:

app.get('/auth/wrike',
  passport.authorize('wrike'));

app.get('/auth/wrike/callback', 
  passport.authorize('wrike', { successRedirect: '/', 
                                failureRedirect: '/login' }));

Thanks

License

The MIT License

Copyright (c) 2015 Lucas Monteverde [http://github.com/lucasmonteverde](http://github.com/lucasmonteverde)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100