加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 无法检索访问令牌linkedin api

发布时间:2020-12-13 14:12:50 所属栏目:PHP教程 来源:网络整理
导读:我正在申请与linkedin连接.我正在关注 step by step guide.要对用户进行身份验证,我从 this开始提供帮助. 当用户单击“使用linkedin连接”按钮时,用户将进入linkedin登录页面.用户授予帐户访问权限后,用户将被重定向到: https://www.linkedin.com/uas/oauth
我正在申请与linkedin连接.我正在关注 step by step guide.要对用户进行身份验证,我从 this开始提供帮助.

当用户单击“使用linkedin连接”按钮时,用户将进入linkedin登录页面.用户授予帐户访问权限后,用户将被重定向到:

https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=1ba8ogpm9e05&scope=r_basicprofile%20r_emailaddress&state=STATE&redirect_uri=http://127.0.0.1:8088/sandbox/linkedin/test.php

通过这个,我得到了授权码.并将其传递给以下网址

https://www.linkedin.com/uas/oauth2/accessToken?grant_type=authorization_code&code=AUTHORIZATION_CODE&redirect_uri=http://127.0.0.1:8088/sandbox/linkedin/final.php&client_id=1ba8ogpm9e05&client_secret=n7GN09I3F2L3IJD1

在这里,错误来了,即

"error":"invalid_request","error_description":"missing required parameters,includes an invalid parameter value,parameter more then once. : Unable to retrieve access token : appId or redirect uri does not match authorization code or authorization code expired"

我哪里错了?我仔细检查了我的api密钥和密钥.

https://www.linkedin.com/uas/oauth2/accessToken?grant_type=authorization_code&code=AUTHORIZATION_CODE&redirect_uri=http://127.0.0.1:8088/sandbox/linkedin/final.php&client_id=1ba8ogpm9e05&client_secret=n7GN09I3F2L3IJD1
https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=1ba8ogpm9e05&scope=r_basicprofile%20r_emailaddress&state=STATE&redirect_uri=http://127.0.0.1:8088/sandbox/linkedin/test.php

根据LinkedIn authentication guide,这两个应该包含相同的redirect_uri:

Parameter: redirect_uri
Description: Required. Same redirect_uri that you passed in the previous step.
Possible Errors:

  • Different redirect_uri than used during authorization code generation
  • Passed an invalid value
  • Passed an empty or blank value
  • Missing the parameter

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读