LinkedIn OAuth带有InternalOAuthError

时间:2017-01-23 21:01:22

标签: oauth oauth-2.0 linkedin

我们将LinkedIn OAuth用于我们的应用。

该应用程序是用Node.js编写的,因此我们使用 passport passport-linkedin-oauth2 对LinkedIn进行身份验证。

最近,对于我们用户的部分(不是所有),当他们使用LinkedIn进入端点进行身份验证时,他们会被正确地重定向到LinkedIn登录页面,但是登录失败并出现以下错误(这是从我们的日志中提取的):

{  
   "name":"InternalOAuthError",
   "message":"failed to fetch user profile",
   "oauthError":{  
      "statusCode":500,
      "data":"{\n  \"errorCode\": 0,\n  \"message\": \"Internal service error\",\n  \"requestId\": \"UR66QV5XEW\",\n  \"status\": 500,\n  \"timestamp\": 1485202895414\n}"
   }
}

一些谷歌搜索表明问题可能与我们的应用程序的API和/或密钥有关,但如果是这种情况,没有用户将能够进行身份验证。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我们遇到了一个很小的帐户标题栏问题,然后突然之间,我们根本无法为任何帐户请求标题栏 。进行身份验证时,我们专门从profileField中排除了标题。

passport.authenticate( 'linkedin', {
  profileFields: [
    "id",
    "first-name",
    "location",
    "last-name",
    "picture-url",
    "email-address",
    "public-profile-url",
    "positions",
  ],
  scope: [ 'r_basicprofile', 'r_emailaddress' ],
} )