我正在申请connect with linkedin
。我正在关注分步指南 https://code.google.com/p/simple-linkedinphp/wiki/QuickStart。为了验证用户身份,我寻求了帮助this https://developer.linkedin.com/documents/authentication.
当用户点击connect with 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
这两者应该包含相同的redirect_uri
根据LinkedIn 身份验证指南 https://developer.linkedin.com/documents/authentication:
范围: redirect_uri
描述:必需的。相同的redirect_uri
您在上一步中通过的。
可能的错误:
- 不同的
redirect_uri
比授权代码生成期间使用的
- 传递了无效值
- 传递了空值或空白值
- 缺少参数
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)