-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
1 lines (1 loc) · 4.61 KB
/
package.json
1
{"name":"passport-linkedin","version":"0.1.3","description":"LinkedIn authentication strategy for Passport.","keywords":["passport","linkedin","auth","authn","authentication","identity"],"repository":{"type":"git","url":"git://github.com/jaredhanson/passport-linkedin.git"},"bugs":{"url":"http://github.com/jaredhanson/passport-linkedin/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/passport-linkedin","dependencies":{"pkginfo":"0.2.x","passport-oauth":"0.1.x"},"devDependencies":{"vows":"0.6.x"},"scripts":{"test":"NODE_PATH=lib node_modules/.bin/vows test/*-test.js"},"engines":{"node":">= 0.4.0"},"readme":"# Passport-LinkedIn\n\n[Passport](http://passportjs.org/) strategy for authenticating with [LinkedIn](http://www.linkedin.com/)\nusing the OAuth 1.0a API.\n\nThis module lets you authenticate using LinkedIn in your Node.js applications.\nBy plugging into Passport, LinkedIn 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-linkedin\n\n## Usage\n\n#### Configure Strategy\n\nThe LinkedIn authentication strategy authenticates users using a LinkedIn\naccount and OAuth tokens. The strategy requires a `verify` callback, which\naccepts these credentials and calls `done` providing a user, as well as\n`options` specifying a consumer key, consumer secret, and callback URL.\n\n passport.use(new LinkedInStrategy({\n consumerKey: LINKEDIN_API_KEY,\n consumerSecret: LINKEDIN_SECRET_KEY,\n callbackURL: \"http://127.0.0.1:3000/auth/linkedin/callback\"\n },\n function(token, tokenSecret, profile, done) {\n User.findOrCreate({ linkedinId: profile.id }, function (err, user) {\n return done(err, user);\n });\n }\n ));\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'linkedin'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n app.get('/auth/linkedin',\n passport.authenticate('linkedin'));\n \n app.get('/auth/linkedin/callback', \n passport.authenticate('linkedin', { failureRedirect: '/login' }),\n function(req, res) {\n // Successful authentication, redirect home.\n res.redirect('/');\n });\n\n#### Extended Permissions\n\nIf you need extended permissions from the user, the permissions can be requested\nvia the `scope` option to `passport.authenticate()`.\n\nFor example, this authorization requests permission to the user's basic profile\nand email address:\n\n app.get('/auth/linkedin',\n passport.authenticate('linkedin', { scope: ['r_basicprofile', 'r_emailaddress'] }));\n\n#### Profile Fields\n\nThe LinkedIn profile is very rich, and may contain a lot of information. The\nstrategy can be configured with a `profileFields` parameter which specifies a\nlist of fields your application needs. For example, to fetch the user's ID, name,\nemail address, and headline, configure strategy like this.\n\n passport.use(new LinkedInStrategy({\n // clientID, clientSecret and callbackURL\n profileFields: ['id', 'first-name', 'last-name', 'email-address', 'headline']\n },\n // verify callback\n ));\n\n## Examples\n\nFor a complete, working example, refer to the [login example](https://github.com/jaredhanson/passport-linkedin/tree/master/examples/login).\n\n## Tests\n\n $ npm install --dev\n $ make test\n\n[![Build Status](https://secure.travis-ci.org/jaredhanson/passport-linkedin.png)](http://travis-ci.org/jaredhanson/passport-linkedin)\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","_id":"passport-linkedin@0.1.3","dist":{"shasum":"c3e25bcc224921f632bd6fec4357972fb16452ac","tarball":"http://registry.npmjs.org/passport-linkedin/-/passport-linkedin-0.1.3.tgz"},"_npmVersion":"1.1.62","_npmUser":{"name":"jaredhanson","email":"jaredhanson@gmail.com"},"maintainers":[{"name":"jaredhanson","email":"jaredhanson@gmail.com"}],"directories":{},"_shasum":"c3e25bcc224921f632bd6fec4357972fb16452ac","_from":"passport-linkedin@^0.1.3","_resolved":"https://registry.npmjs.org/passport-linkedin/-/passport-linkedin-0.1.3.tgz","homepage":"https://github.com/jaredhanson/passport-linkedin"}