看来您已经成功获取了OAuth 2.0访问令牌,在进行API调用时需要在查询参数中传递access_token。这就是处理OAuth
2.0身份验证的方式(OAuth 1.0要求访问令牌位于标头中,而OAuth 2.0依赖于查询参数)。
例如:
GET
https://api.linkedin.com/v1/people/~?oauth2_access_token=
如果需要更多详细信息,请单击链接:https : //developer-
programs.linkedin.com/forum/unknown-authentication-scheme
如果将令牌与访问受保护资源的请求一起发送,则应该获得以下详细信息。
更正的代码段:
request= new OAuthBearerClientRequest ("https://api.linkedin.com/v1/people/~?oauth2_access_token="+oAuthResponse.getAccessToken()). buildQueryMessage();在我的示例中,我得到以下 HTTP 200 OK 响应,只是想向您展示。
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><person> <id>LLIyXMKhNI</id> <first-name>FirstName</first-name> <last-name>LastName</last-name> <headline>Spring Developer at Amazon</headline> <site-standard-profile-request> <url>https://www.linkedin.com/profile/view?id=154416688&authType=name&authToken=ipNL&trk=api*a4360331*s4423501*</url> </site-standard-profile-request></person>
希望这会对您有所帮助。



