node.js - InternalOAuthError when using passport-linkedin strategy -
i'm working passport-linkedin , i'm getting error.
internaloautherror: failed obtain request token @ /users/davey/code/node/appify-frontend/node_modules/passport-linkedin/node_modules/passport-oauth/lib/passport-oauth/strategies/oauth.js:196:36 @ /users/davey/code/node/appify-frontend/node_modules/passport-linkedin/lib/passport-linkedin/strategy.js:80:19 @ passbackcontrol (/users/davey/code/node/appify-frontend/node_modules/passport-linkedin/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:397:13) @ incomingmessage.<anonymous> (/users/davey/code/node/appify-frontend/node_modules/passport-linkedin/node_modules/passport-oauth/node_modules/oauth/lib/oauth.js:409:9) @ incomingmessage.emit (events.js:129:20) @ _stream_readable.js:908:16 @ process._tickcallback (node.js:355:11) /oauth/linkedin 500 1074ms - 786b
here's setup looks like
exports.setup = function (config) { var passport = require('passport'); var linkedinstrategy = require('passport-linkedin').strategy; passport.use(new linkedinstrategy({ consumerkey: config.linkedin.clientid, consumersecret: config.linkedin.clientsecret, callbackurl: config.linkedin.callbackurl }, function(token, tokensecret, profile, done) { console.log(token, tokensecret, profile); return done(null, true); } )); };
and routing setup follows
router .get('/', function(req, res, next) { console.log("[oauth2:redirect:query]:", json.stringify(req.query)); console.log("[oauth2:redirect:body]:", json.stringify(req.body)); next(); }, passport.authenticate('linkedin', { failureredirect: '/settings/connected-accounts', session: false })) .get('/callback', passport.authenticate('linkedin', { failureredirect: '/settings/connected-accounts', session: false }), function (req, res){ res.redirect('/settings/connected-accounts'); });
in same app, i've setup twitter , facebook oauth, both of work well. have no idea what's causing error , have tried everything.
in linkedin developer account, i've configured should be.
authorized redirect urls:
http://testdomain.ngrok.io/oauth/linkedin/callback
default "accept" redirect url:
http://testdomain.ngrok.io/settings/connected-accounts
i first used localhost url running on port 9000, when failed, exposed app running locally live url, still had same error. appreciated. thanks
the internaloautherror
related passport-oauth1 ( https://github.com/jaredhanson/passport-linkedin/blob/master/lib/strategy.js ) , use oauth2 according routing setup. try switching passport-linkedin-oauth2
Comments
Post a Comment