passport-weibonew
Version:
Renren authentication strategy for Passport.
51 lines (50 loc) • 3.53 kB
JSON
{
"name": "passport-weibonew",
"version": "0.1.0",
"description": "Renren authentication strategy for Passport.",
"keywords": [
"passport",
"weibo",
"auth",
"authn",
"authentication",
"identity"
],
"repository": {
"type": "git",
"url": "http://github.com/xinbenlv/passport-weibo.git"
},
"bugs": {
"url": "http://github.com/xinbenlv/passport-weibo/issues"
},
"author": {
"name": "Zainan Victor Zhou",
"email": "xinbenlv@gmail.com",
"url": "http://www.zzn.im/"
},
"licenses": [
{
"type": "MIT",
"url": "http://www.opensource.org/licenses/MIT"
}
],
"main": "./lib/passport-weibo",
"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-Weibo\n\ncopied and revised from passport-weibo\n\n[Passport](http://passportjs.org/) strategy for authenticating with [Weibo](https://weibo.com/)\nusing the OAuth 2.0 API.\n\nThis module lets you authenticate using Weibo in your Node.js applications.\nBy plugging into Passport, Weibo 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-weibo\n\n## Usage\n\n#### Configure Strategy\n\nThe Weibo authentication strategy authenticates users using a Weibo account\nand OAuth 2.0 tokens. The strategy requires a `verify` callback, which accepts\nthese credentials and calls `done` providing a user, as well as `options`\nspecifying a client ID, client secret, and callback URL.\n\n passport.use(new WeiboStrategy({\n clientID: WEIBO_CLIENT_ID,\n clientSecret: WEIBO_CLIENT_SECRET,\n callbackURL: \"http://127.0.0.1:3000/auth/weibo/callback\"\n },\n function(accessToken, refreshToken, profile, done) {\n User.findOrCreate({ weiboId: profile.id }, function (err, user) {\n return done(err, user);\n });\n }\n ));\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'weibo'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n app.get('/auth/weibo',\n passport.authenticate('weibo'));\n\n app.get('/auth/weibo/callback', \n passport.authenticate('weibo', { 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 [login example](https://github.com/xinbenlv/passport-weibo/tree/master/examples/login).\n\n## Tests\n\n $ npm install --dev\n $ make test\n\n[](http://travis-ci.org/xinbenlv/passport-weibo)\n\n## Credits\n\n - [Jared Hanson](http://github.com/jaredhanson)\n - [Zainan Victor Zhou](http://github.com/xinbenv)\n\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2013 Zainan Victor Zhou <[http://zzn.im/](http://www.zzn.im/)>\n\n",
"readmeFilename": "README.md",
"homepage": "https://github.com/xinbenlv/passport-weibo",
"_id": "passport-weibo@0.1.0",
"_from": "passport-weibo@^0.1.0"
}