-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
1 lines (1 loc) · 4.33 KB
/
package.json
1
{"name":"passport-twitter","version":"1.0.2","description":"Twitter authentication strategy for Passport.","keywords":["passport","twitter","auth","authn","authentication","identity"],"repository":{"type":"git","url":"git://github.com/jaredhanson/passport-twitter.git"},"bugs":{"url":"http://github.com/jaredhanson/passport-twitter/issues"},"author":{"name":"Jared Hanson","email":"jaredhanson@gmail.com","url":"http://www.jaredhanson.net/"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"passport-oauth1":"1.x.x","xtraverse":"0.1.x"},"devDependencies":{"mocha":"1.x.x","chai":"1.x.x","chai-passport-strategy":"0.1.x"},"engines":{"node":">= 0.4.0"},"scripts":{"test":"mocha --reporter spec --require test/bootstrap/node test/*.test.js"},"readme":"# passport-twitter\n\n[![Build](https://travis-ci.org/jaredhanson/passport-twitter.png)](http://travis-ci.org/jaredhanson/passport-twitter)\n[![Coverage](https://coveralls.io/repos/jaredhanson/passport-twitter/badge.png)](https://coveralls.io/r/jaredhanson/passport-twitter)\n[![Dependencies](https://david-dm.org/jaredhanson/passport-twitter.png)](http://david-dm.org/jaredhanson/passport-twitter)\n\n\n[Passport](http://passportjs.org/) strategy for authenticating with [Twitter](http://twitter.com/)\nusing the OAuth 1.0a API.\n\nThis module lets you authenticate using Twitter in your Node.js applications.\nBy plugging into Passport, Twitter authentication can be easily and\nunobtrusively integrated into any application or framework that supports\n[Connect](http://www.senchalabs.org/connect/)-style middleware, including\n[Express](http://expressjs.com/).\n\n## Install\n\n $ npm install passport-twitter\n\n## Usage\n\n#### Configure Strategy\n\nThe Twitter authentication strategy authenticates users using a Twitter account\nand OAuth tokens. The strategy requires a `verify` callback, which receives the\naccess token and corresponding secret as arguments, as well as `profile` which\ncontains the authenticated user's Twitter profile. The `verify` callback must\ncall `done` providing a user to complete authentication.\n\nIn order to identify your application to Twitter, specify the consumer key,\nconsumer secret, and callback URL within `options`. The consumer key and secret\nare obtained by [creating an application](https://dev.twitter.com/apps) at\nTwitter's [developer](https://dev.twitter.com/) site.\n\n passport.use(new TwitterStrategy({\n consumerKey: TWITTER_CONSUMER_KEY,\n consumerSecret: TWITTER_CONSUMER_SECRET,\n callbackURL: \"http://127.0.0.1:3000/auth/twitter/callback\"\n },\n function(token, tokenSecret, profile, done) {\n User.findOrCreate({ twitterId: profile.id }, function (err, user) {\n return done(err, user);\n });\n }\n ));\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'twitter'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n app.get('/auth/twitter',\n passport.authenticate('twitter'));\n \n app.get('/auth/twitter/callback', \n passport.authenticate('twitter', { failureRedirect: '/login' }),\n function(req, res) {\n // Successful authentication, redirect home.\n res.redirect('/');\n });\n\n## Examples\n\nFor a complete, working example, refer to the [signin example](https://github.com/jaredhanson/passport-twitter/tree/master/examples/signin).\n\n## Tests\n\n $ npm install\n $ npm test\n\n## Credits\n\n - [Jared Hanson](http://github.com/jaredhanson)\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2011-2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>\n","readmeFilename":"README.md","_id":"passport-twitter@1.0.2","dist":{"shasum":"6bfe5f9ec259dc363991b0be3cee94bfe4853d2b","tarball":"http://registry.npmjs.org/passport-twitter/-/passport-twitter-1.0.2.tgz"},"_from":"passport-twitter@^1.0.2","_npmVersion":"1.2.25","_npmUser":{"name":"jaredhanson","email":"jaredhanson@gmail.com"},"maintainers":[{"name":"jaredhanson","email":"jaredhanson@gmail.com"}],"directories":{},"_shasum":"6bfe5f9ec259dc363991b0be3cee94bfe4853d2b","_resolved":"https://registry.npmjs.org/passport-twitter/-/passport-twitter-1.0.2.tgz","homepage":"https://github.com/jaredhanson/passport-twitter"}