无法使用有效的oauth2访问令牌访问Linkedin个人资料 [英] Unable to access Linkedin profile with valid oauth2 access token

查看:109
本文介绍了无法使用有效的oauth2访问令牌访问Linkedin个人资料的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到 LinkedIn OAuth2中描述的相同问题: 无法验证访问令牌" ;但是,那里描述的解决方案不能解决我的问题.

I am having the same problem that is described in LinkedIn OAuth2: "Unable to verify access token"; however, the solution described there does not fix my problem.

我能够成功请求访问令牌;但是,当我使用它发出请求时(使用Authorization标头或oauth2_access_token查询参数),我收到401错误:

I am able to successfully request an access token; however, when I make a request with it (using either the Authorization header or the oauth2_access_token query param), I get a 401 failure:

$ curl "https://api.linkedin.com/v1/people/~?format=json&oath2_access_token=############"
{
  "errorCode": 0,
  "message": "Unable to verify access token",
  "requestId": "Z9ZJ1MOUM0",
  "status": 401,
  "timestamp": 1440096560396
}
$curl --header  "Authorization: Bearer #############" 'https://api.linkedin.com/v1/people/~?format=json'
{
  "errorCode": 0,
  "message": "Unable to verify access token",
  "requestId": "Y1P2PEBEC3",
  "status": 401,
  "timestamp": 1440096564518

奇怪的是:

  1. 如果用户登录Linkedin,此问题不会出现.

  1. This problem doesn't surface if the user is logged into Linkedin.

如果您等待五分钟,该请求将开始生效.

If you wait five minutes, the request will just start working.

我猜这是Linkedin中的一个错误,关于基于用户登录状态授权访问代码的延迟,但是我不知道.

My guess this is a bug in Linkedin about latency of authorizing access codes based the users' logged in state, but I don't know.

我也感到奇怪的是,Linkedin授权表显示为登录LinkedIn并允许访问:";但是,当您输入凭据并单击允许访问"时,实际上并没有登录Linkedin.

Also I find it strange that the Linkedin authorization form reads, "Sign in to LinkedIn and allow access:"; however, when you put in your credentials and click "Allow access", you are not actually logged into Linkedin.

我的代码上周运行良好.还有其他人看到吗?

My code was working fine on last week. Anyone else seeing this?

推荐答案

好像您有 oath2_access_token 而不是 oauth_access_token 一样?不知道这是手动粘贴失败还是实际问题.

Looks like you have oath2_access_token there instead of oauth_access_token ? Not sure if this is a hand-paste failure or the actual issue.

curl "https://api.linkedin.com/v1/people/~?format=json&oath2_access_token=############"

这篇关于无法使用有效的oauth2访问令牌访问Linkedin个人资料的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆