[英]LinkedIn integration with scribe
有人可以幫助后端上的linkedIn集成。 這是麻煩,我有oauth_token(已經用linkedIn javascript api響應了),並且我想在后端使用此令牌。
這是示例:
OAuth20Service service = new ServiceBuilder()
.apiKey(getLinkedInClientId())
.scope("r_basicprofile r_emailaddress") // replace with desired scope
.apiSecret(getLinkedInSecret())
.build(LinkedInApi20.instance());
try {
OAuth2AccessToken accessToken = new OAuth2AccessToken(props.getToken(), "Bearer", 0, null, null, null);
final OAuthRequest request = new OAuthRequest(Verb.GET, String.format("https://api.linkedin.com/v1/people/~"),
service);
request.addHeader("x-li-format", "json");
request.addHeader("Accept-Language", "ru-RU");
service.signRequest(accessToken, request);
final Response response = request.send();
String body = response.getBody();
response.getMessage();
} catch (Exception e) {
e.printStackTrace();
}
總是說我的令牌無效。
{
"errorCode": 0,
"message": "Invalid access token.",
"requestId": "OKZVL3STZK",
"status": 401,
"timestamp": 1472554177625
}
我也嘗試了Apache oltu客戶端而沒有運氣(
似乎我沒有獲得有效的令牌,因為當我使用https://apigee.com/console/linkedin時,一切都很好
我使用的令牌不是access_token,因此我選擇將OAuth2用於后端實現。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.