首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用hello.js登录instagram

使用hello.js登录instagram
EN

Stack Overflow用户
提问于 2017-08-03 03:31:15
回答 1查看 482关注 0票数 3

我尝试用hello.js登录instagram,但它从来没有直接指向https://api.instagram.com/oauth/authorize,否则它会立即指向我的重定向url,所以我无法获取访问令牌。下面是我的代码:

代码语言:javascript
复制
    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
    });
EN

回答 1

Stack Overflow用户

发布于 2017-10-31 19:07:51

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

代码语言:javascript
复制
hello.init(
    {
        instagram: INSTAGRAM_ID
    },
    {
        redirect_uri: helloOAuthCallback,
        popup       : {
            location: 'no'
        },
        oauth_proxy : oauthproxy_url,
        response_type: 'token'
    }
);

现在它对我起作用了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45469467

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档