我使用IBM Cloud App ID”,并且我想使用LinkedIn作为提供者。
但是,在批准应用时会出现“ InternalOAuthError ”。
IBM Cloud博客上有一个示例。
Sign In Your App Users With Any Identity Provider Using App ID
我按照此流程尝试了示例应用程序。登录LinkedIn似乎已成功,但是在批准该应用程序时发生了以下错误。
InternalOAuthError: failed to fetch user profile
at _oauth2.get (C:\xxx\AppIdCustomIdentity\node_modules\passport-linkedin-oauth2\lib\oauth2.js:70:23)
at passBackControl (C:\xxx\AppIdCustomIdentity\node_modules\oauth\lib\oauth2.js:132:9)
at IncomingMessage.<anonymous> (C:\xxx\AppIdCustomIdentity\node_modules\oauth\lib\oauth2.js:157:7)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1094:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
请帮助!
当我尝试使用此post时,不再发生“ InternalOAuthError”。
但是发生了另一个错误。
Error: Failed to obtain tokens
at Request.request [as _callback] (C:\xxx\AppIdCustomIdentity\node_modules\ibmcloud-appid\lib\token-manager\token-manager.js:118:13)
at Request.self.callback (C:\xxx\AppIdCustomIdentity\node_modules\request\request.js:185:22)
at Request.emit (events.js:182:13)
at Request.<anonymous> (C:\xxx\AppIdCustomIdentity\node_modules\request\request.js:1161:10)
at Request.emit (events.js:182:13)
at IncomingMessage.<anonymous> (C:\xxx\AppIdCustomIdentity\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:273:13)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1094:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
答案 0 :(得分:1)
如本文中的建议(https://stackoverflow.com/a/56329029/10422503)所示,似乎passport-linkedin-oauth2
库尚未针对LinkedIn 2.0 API进行过更新。尝试使用那里建议的叉子
答案 1 :(得分:0)
看一下堆栈跟踪,看起来好像异常来自passport-linkedin-oauth2模块。
at _oauth2.get (C:\xxx\AppIdCustomIdentity\node_modules\passport-linkedin-oauth2\lib\oauth2.js:70:23)
Google搜索InternalOAuthError: failed to fetch user profile +linkedin
提供了一些您可能想尝试的选项。