linkedin oauth 授权失败,并显示“糟糕,出了问题”

问题描述 投票:0回答:6

Bummer, something went wrong

https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=test&redirect_uri=http://test.custom.com/abc/linkedin&state=DCEeFWf45A53sdfKef424asgTyhgTR5

当我使用上面的网址时,我收到“糟糕,出了问题。 我们连接时遇到困难。”

oauth-2.0 linkedin-api
6个回答
14
投票

您需要添加“使用 LinkedIn 登录”权限。

  • 转到您的应用程序页面
  • 转到产品选项卡(对于您的应用程序,不是在顶部;有两个)
  • 在“使用 LinkedIn 登录”产品和“在 LinkedIn 上共享”产品上选择“请求访问权限”。这将授予对以下权限的访问权限:r_emailaddress、r_liteprofile、w_member_social。

6
投票

您好,我遇到了类似的问题,我通过这样做解决了它;

您必须确保您的APP页面(https://www.linkedin.com/developer/apps)中的所有内容都与您的授权URL中的参数匹配。例如,在您的情况下,https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=test&redirect_uri=http://test.custom.com/abc/linkedin&state=DCEeFWf45A53sdfKef424asgTyhgTR5

您必须确保 auth URL 中的 client_id 与您的 APP 页面上的 Client-Id 匹配,并确保您在 auth URL 中指定的 redirect_uri 已在您的应用页面上获得授权,如下所示。如果您也传递范围,还要确保它们完美匹配。如下图所示,我的redirect_uri 已从我的应用程序页面获得授权。


2
投票

最好的方法是检查 linkedin 开发者工具如何为您生成链接,然后您只需更改重定向 url

https://www.linkedin.com/developers/tools/oauth

然后“创建令牌”,然后选择所有权限并单击“请求访问令牌” 如果您打开开发窗口,您可以看到查询授权已完成,然后您只需复制此网址并更改redirect_url即可。

enter image description here]1

所以对我来说 https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=myclientid&redirect_uri=myredirectid&scope=r_emailaddress%2Cr_liteprofile%2Cw_member_social&state=e6c0e1c8-1a35-478f-8eea-b0412a6675c9


1
投票

2018 年 12 月 15 日后重新创建应用程序为我解决了问题。 (2018 年 12 月 15 日之后通过 LinkedIn 开发人员门户创建的任何开发人员应用程序都会自动访问 v2 API。) https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration -faq?context=linkedin/consumer/context


0
投票

LinkedIn 已弃用旧的身份验证,现在您需要使用 OpenID 连接产品,因为您需要在路由中使用 linkedin-openid 而不是 linkedin:

From: http://localhost:8000/linkedin/callback
To: http://localhost:8000/linkedin-openid/callback

也不要忘记请求访问“使用 OpenID Connect 通过 LinkedIn 登录”产品


-1
投票

我遇到了同样的问题。

将 linkedin 应用程序中

redirect_uri
的值从
http
更改为
https
有助于解决该问题。见下图:


在你的情况下,网址应该是:

https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=test&redirect_uri=https://test.custom.com/abc/linkedin&state=DCEEFWf45A53sdfKef424asgTyhgTR5;

© www.soinside.com 2019 - 2024. All rights reserved.