2016-09-07 87 views
0

我已通過Auth0成功獲取了access_token發佈的Twitter身份驗證。我正在嘗試在標題中使用access_token,但我從Twitter獲得401錯誤。通過Auth0訪問Twitter API後驗證

$http.defaults.headers.common['Authorization'] = 'Bearer ' + localStorage.getItem('twitter_access_token');   

    $http.jsonp('https://api.twitter.com/1.1/statuses/user_timeline.json?callback=JSON_CALLBACK').then(
     function (response) { 
      console.log(response); 
     }, 
     function (response) { 
      console.log(response); 
     } 
    ); 

我在做什麼錯?

回答