passport-renren
Advanced tools
Comparing version 0.1.1 to 0.1.3
@@ -62,3 +62,3 @@ /** | ||
this.name = 'renren'; | ||
this._userProfileURL = options.userProfileURL || 'https://api.renren.com/restserver.do'; | ||
this._userProfileURL = options.userProfileURL || 'https://api.renren.com/v2/user/get'; | ||
} | ||
@@ -92,20 +92,15 @@ | ||
Strategy.prototype.userProfile = function(accessToken, done) { | ||
this._oauth2._request('POST', this._userProfileURL + '?access_token=' + accessToken + '&format=json&method=users.getInfo', | ||
{'content-type': 'application/x-www-form-urlencoded'} , accessToken, '', function (err, body, res) { | ||
this._oauth2._request('GET', this._userProfileURL + '?access_token=' + accessToken, | ||
{} , '', '', function (err, body, res) { | ||
if (err) { return done(new InternalOAuthError('failed to fetch user profile', err)); } | ||
try { | ||
var json = JSON.parse(body)[0]; | ||
var json = JSON.parse(body).response; | ||
var profile = { provider: 'renren' }; | ||
profile.id = json.uid; | ||
profile.tinyurl = json.tinyurl; | ||
profile.id = json.id; | ||
profile.displayName = json.name; | ||
profile.vip = json.vip; | ||
profile.name = json.name; | ||
profile.star = json.star; | ||
profile.headurl = json.headurl; | ||
profile.zidou = json.zidou; | ||
profile._raw = body; | ||
@@ -112,0 +107,0 @@ profile._json = json; |
{ | ||
"name": "passport-renren", | ||
"version": "0.1.1", | ||
"description": "Renren authentication strategy for Passport.", | ||
"version": "0.1.3", | ||
"description": "Renren authentication strategy for Passport. Supports API 2.0", | ||
"keywords": ["passport", "renren", "auth", "authn", "authentication", "identity"], | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -8,4 +8,4 @@ # Passport-Renren | ||
This module lets you authenticate using GitHub in your Node.js applications. | ||
By plugging into Passport, GitHub authentication can be easily and | ||
This module lets you authenticate using Renren in your Node.js applications. | ||
By plugging into Passport, Renren authentication can be easily and | ||
unobtrusively integrated into any application or framework that supports | ||
@@ -23,3 +23,3 @@ [Connect](http://www.senchalabs.org/connect/)-style middleware, including | ||
The GitHub authentication strategy authenticates users using a GitHub account | ||
The Renren authentication strategy authenticates users using a Renren account | ||
and OAuth 2.0 tokens. The strategy requires a `verify` callback, which accepts | ||
@@ -29,3 +29,3 @@ these credentials and calls `done` providing a user, as well as `options` | ||
passport.use(new GitHubStrategy({ | ||
passport.use(new RenrenStrategy({ | ||
clientID: RENREN_CLIENT_ID, | ||
@@ -32,0 +32,0 @@ clientSecret: RENREN_CLIENT_SECRET, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44267
16
119