Sunday 15 July 2012

javascript - NodeJs, 500 failed to obtain access token (Error: connect ECONNREFUSED) at at process._tickCallback (node.js:419:13) -



javascript - NodeJs, 500 failed to obtain access token (Error: connect ECONNREFUSED) at at process._tickCallback (node.js:419:13) -

i using passport googlestrategy authenticate users, getting below error. can please help me ?

code

passport.use(new googleoauth2strategy({ clientid : configauth.googleauth.clientid, clientsecret: configauth.googleauth.clientsecret, callbackurl: configauth.googleauth.callbackurl, scope: ['profile', 'email', 'openid'], passreqtocallback : true },

function(token, refreshtoken, profile, done) { // user.findone won't fire until have our info google process.nexttick(function() { console.log(profile.id); user.findone({ 'google.id' : profile.id }, function(err, user) { if (err) homecoming done(err); if (user) { homecoming done(null, user); } else { var newuser = new user(); newuser.google.id = profile.id; newuser.google.token = token; newuser.google.name = profile.displayname; newuser.google.email = profile.emails[0].value; console.log(profile.id); console.log(token); console.log(profile.displayname); console.log(profile.emails[0].value); // save user newuser.save(function(err) { if (err) throw err; homecoming done(null, newuser); }); } }); });

error log

500 failed obtain access token (error: connect econnrefused) @ d:\chandrasekhar\nodejs_workspace\skillsetmgmtnode\node_modules\passport-google-oauth\node_modules\passport-oauth\lib\passport-oauth\strategies\oauth2.js:125:38 @ d:\chandrasekhar\nodejs_workspace\skillsetmgmtnode\node_modules\passport-google-oauth\node_modules\passport-oauth\node_modules\oauth\lib\oauth2.js:177:18 @ clientrequest. (d:\chandrasekhar\nodejs_workspace\skillsetmgmtnode\node_modules \passport-google-oauth\node_modules\passport-oauth\node_modules\oauth\lib\oauth2.js:148:5)

javascript node.js express oauth passport.js

1 comment:

  1. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. pasaport almak için gerekli evraklar

    ReplyDelete