javascript - 使用 hello.js 登录 Instagram

标签 javascript hello.js

我尝试使用 hello.js 登录 Instagram,但它从未定向到 https://api.instagram.com/oauth/authorize ,否则它会立即定向到我的重定向网址,因此我无法获取访问 token 。这是我的代码:

    hello('instagram').login({redirect_uri : instagram_redirect_url, 
    scope: 'basic, publish'}, function(e){
                if(e.error){

                }else{
                    var instagram_access_token = 
    hello('instagram').getAuthResponse().oauth_token;
                    var instagram_secret = 
    hello('instagram').getAuthResponse().oauth_token_secret;
                    console.log(instagram_access_token);
                    console.log(instagram_secret);
                }
            });
    hello.init ({
        instagram: instagram_client_id
    });

最佳答案

我发现我必须将 response_type 更改为 token:

hello.init(
    {
        instagram: INSTAGRAM_ID
    },
    {
        redirect_uri: helloOAuthCallback,
        popup       : {
            location: 'no'
        },
        oauth_proxy : oauthproxy_url,
        response_type: 'token'
    }
);

现在它对我有用。

关于javascript - 使用 hello.js 登录 Instagram,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45469467/

相关文章:

redirect - 不支持 hello.js facebook 登录重定向 uri,应用程序 ID 无效

twitter - 如何设置 hello.js 以访问 Twitter?

多个 OAuth 2.0 的 Javascript 库

javascript - SharePoint 2010 客户端对象模型 + 使用 Javascript 设置多个查找字段的值

javascript - 如何提高谷歌驱动器配额限制?

javascript - 在 Cypress 中检查输入值是否小于 x 的正确方法是什么?

javascript - 如何使用 Angularjs 在 Protractor 中选择可见元素

javascript - 使用 hello js 获取雅虎好友列表

javascript - 从hellojs获取refresh_token

javascript - jQuery 的 URL 验证次数