簡體   English   中英

instafeed.js停止工作:提供的access_token無效

[英]instafeed.js stopped working: The access_token provided is invalid

我正在使用instafeed.js:

var feed = new Instafeed({
        get: 'user',
        userId: 19191919191,
        limit: 9,
        accessToken: 'myaccesstokenhere',
        target: 'instagram',
        resolution: 'standard_resolution',
        after: function() {
            var el = document.getElementById('instagram');
            if (el.classList)
                el.classList.add('show');
            else
                el.className += ' ' + 'show';
        }
});

但我收到這個錯誤:

The access_token provided is invalid.

我通過https://www.instagram.com/developer獲得了access_token我注冊了我的應用程序,並將Client Secret作為accessToken,我從這里獲得了我的用戶ID https://smashballoon.com/instagram-feed/find-instagram -用戶身份/

但它仍然說The access_token provided is invalid. 我究竟做錯了什么?

您不能使用您的客戶端密鑰代替accessToken ,因為客戶端密鑰在服務器端用作OAuth流程的一部分,以便獲取用戶accessToken。

我建議您在此處查看Instagram的身份驗證文檔以確保您使用的是對您的應用程序有意義的身份驗證策略。

聽起來您更有可能想要使用其客戶端隱式身份驗證(在底部 )來獲取訪問令牌。 您甚至可以手動執行此操作,只需獲取accessToken進行測試即可。 一旦你擁有了accessToken,你就可以在instafeed.js的正確字段中使用instafeed.js來加載你想要的Instagram。

您也可以通過訪問http://instagram.pixelunion.net/並使用在那里生成的那個來獲取您自己的accessToken。

似乎你將accessTokenClient Secret混淆,請在此處查看https://www.instagram.com/developer/authentication/

為了讓生活變得輕松,你可以嘗試在這里生成一個http://instagram.pixelunion.net/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM