14
我正在研究該應用程序,允許用戶連接到linkedin(使用javascript)。我想存儲從IN.ENV.auth.oauth_token獲得的訪問令牌,因爲我將使用它來發布到用戶的時間表。get linkedin使用JavaScript SDK訪問令牌
但是,當我使用此訪問令牌發佈到Linkedin時,我得到了「無效的訪問令牌」錯誤。 我使用了正確的訪問令牌嗎?如何獲得Access令牌的正確方法?
這裏是我的代碼:
$("#linkedin-connect").on('click',function(e){
e.preventDefault();
IN.UI.Authorize().place();
IN.Event.on(IN, "auth", OnLinkedInAuth);
return false;
});
function OnLinkedInAuth() {
console.debug("oauth token:" + IN.ENV.auth.oauth_token);
}
你是否從[OAuth認證](https://developer.linkedin.com/docs/oauth2)使用[LinkedIn API(https://developer.linkedin.com/docs)? –
我按照這裏的說明https://developer.linkedin.com/docs/js-sdk。在回調函數中,我捕獲了IN.ENV.auth.oauth_token;如果它不是正確的訪問令牌,那麼獲得它的正確方法是什麼? – sakura
請向我們展示您用來獲取IN.ENV.auth.oauth_token的代碼。 –