简体   繁体   English

Instagram登录hello.js

[英]instagram login with hello.js

I tried to login instagram with hello.js, but it never direct to https://api.instagram.com/oauth/authorize , otherwise it directs to my redirect url immediately, so I cannot get access token. 我尝试使用hello.js登录instagram,但它从未指向https://api.instagram.com/oauth/authorize ,否则它会立即指向我的重定向网址,因此我无法获取访问令牌。 Here's my code: 这是我的代码:

    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
    });

I found that I had to change response_type to token : 我发现我必须将response_type更改为token

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

Now it works for me. 现在它对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM