我目前正在开发NodeJS应用,并打算检索Linkedin用户的经验,知识和技能。这样做时,我得到下面的错误。如何避免此错误?
此处导致错误的工作流程如下:http://3.14.113.64:4000/
InternalOAuthError: failed to fetch user profile
at _oauth2.get (/linkedin-connection/node_modules/passport-linkedin-oauth2/lib/oauth2.js:70:23)
at passBackControl (/linkedin-connection/node_modules/oauth/lib/oauth2.js:132:9)
at IncomingMessage.<anonymous> (/linkedin-connection/node_modules/oauth/lib/oauth2.js:157:7)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
答案 0 :(得分:0)
看起来像是此库的已知问题: https://github.com/auth0/passport-linkedin-oauth2/issues/75
此问题未报告此模块尚未更新为linkedin API 2.0
将其切换为分叉:
npm install @sokratis/passport-linkedin-oauth2
并替换require / import语句:
var LinkedInStrategy = require('@sokratis/passport-linkedin-oauth2').Strategy;