LinkedIn,401,无法验证访问令牌 [英] LinkedIn, 401, Unable to verify access token
问题描述
我使用本指南构建了一个展示柜-使用LinkedIn登录到特定站点. 一切都完美,直到我在广大观众面前演示了它,然后它崩溃了:-(这是一次失败的尝试,我想知道为什么.这是我的工作:
I used this guide to built a showcase - sign in with LinkedIn into a specific site. Everything worked perfectly until I demonstarted it in front of a wide audience and it broke down :-( It was a great FAIL and I want to know why. Here is what I do:
1.在登录页面上,用户可以单击Sign in with LinkedIn
按钮,然后将其重定向到类似的链接:
1.On the sign in page the user may click a Sign in with LinkedIn
button and is redirected to similar link:
https://www.linkedin.com/oauth/v2/authorization?redirect_uri=[my_callback]&client_id=[my_client_id]&response_type=code&state=[securely_random]&scope=r_basicprofile%20r_emailaddress
2.用户允许该应用程序并被发送回my_callback
2.The user allows the application and is sent back to my_callback
3.在my_callback
中,我对https://www.linkedin.com/oauth/v2/accessToken
进行了POST以获取访问令牌.我使用了LinkedIn发送的代码,正确的客户ID和密码.一切正常,例如响应可能是:
3.In my_callback
I make a POST to https://www.linkedin.com/oauth/v2/accessToken
in order to obtain an access token. I use the code sent by LinkedIn, correct client ID and secret. Everything is OK, e.g the response might be:
{
"access_token": [access_token],
"expires_in": 5184000
}
4.我发出了经过身份验证的请求,以从端点https://www.linkedin.com/v1/people/~:(firstName,lastName,email_address)
4.I make authenticated requests to fetch the profile data from endpoint https://www.linkedin.com/v1/people/~:(firstName,lastName,email_address)
标题:
x-li-format: json
Authorization: Bearer [access_token]
我偶尔开始收到错误401,例如:
I started to get an error 401 occasionally, e.g.:
{
"errorCode": 0,
"message": "Unable to verify access token",
"requestId": "YX21AN6NZG",
"status": 401,
"timestamp": 1483732371224
}
似乎有些请求还是随机通过的...
It seems that some of the requests randomly passed nevertheless...
其他详细信息:
- 用户已登录LinkedIn
- 用户是LinkedIn应用程序的管理员
- 我已经检查了应用程序中的限制(油门限制).在
https://www.linkedin.com/developer/apps
中可用.可见的一切都是绿色的. - 我已经尝试过此问题的所有建议和技巧
- 我的应用未启用
- The user is logged in LinkedIn
- The user is administrator for the LinkedIn application
- I have checked the limitations (throttle limits) at in the application. Available at
https://www.linkedin.com/developer/apps
. Everything which can be seen is green. - I have tried all advices and hacks from this question
- My app is not live
我很困惑!
问题:有明显的错误吗?
问题:对于特定用户/应用程序组合的访问令牌数量限制,是否存在任何隐藏的油门限制(或安全工具)? (我一直使用相同的用户,并且在发生重大故障之前进行了非常积极的测试)
Question: Is there any hidden throttle limits (or security instruments) for the limitation of the number of access tokens for specific user/app combination? (I'm always using the same user and I tested pretty aggressively before the big FAIL)
更新:在接下来的两天内,如上所述,登录又开始顺利进行.不再有401-s ...:-X我没有对代码库进行任何更改.那么,这是某种节流阀吗?或者只是李先生周五情绪低落?
UPDATE: In the next two days the Sign in started working smoothly again as described above. No 401-s anymore... :-X I've made no changes to the code base. So is this some kind of throttle limit or just LI was in a bad mood on Friday?
推荐答案
万一有人好奇,我会从LI支持人员那里得到我的问题的答案:
In case someone is curious I got an answer to my problem from LI support:
很遗憾,我们确实无法解决API问题和第三方应用程序.我的猜测是星期五打ic,您是糟糕时机的受害者.
我接受我是受害者的解释,所以这回答了我的问题...
I accept the explanation that I was a victim so this answers my question...
这篇关于LinkedIn,401,无法验证访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!