如何续订过期的LinkedIn访问令牌



我正在尝试续订过期的访问令牌,如文档所示:

https://developer.linkedin.com/documents/authentication

我正在尝试发出这样的 GET 请求:

第一个 GET(用于获取代码):

https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=XXX&scope=r_fullprofile&state=hyriedsdsv56uvenn5eouvnjedfgdfgio5&redirect_uri=http://www.MY_DOMAIN.com

此请求的返回如下所示:

http://www.MY_DOMAIN.com/?code=MY_CODE&state=hyriedsdsv56uvenn5eouvnjedfgdfgio5

在此之后,我必须发出最终请求才能获取我的访问令牌:

https://www.linkedin.com/uas/oauth2/accessToken?grant_type=authorization_code&code=XXX&redirect_uri=http://www.MY_DOMAIN.com&client_id=XXX&client_secret=XXX

LinkedIn返回此错误消息:

{"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"}

有谁知道我应该怎么做才能解决这个问题?我的授权令牌不能过期,因为我在获得授权令牌时正在使用。

我使用的是正确的密钥和应用密钥。

谢谢! =)

20秒似乎两者之间的到期时间。您的 domain.com/..应立即进行访问令牌调用并将其存储在客户端数据库中。

最新更新