2017-08-02 108 views
3

我试图用hello.js登录instagram,但它永远不会直接到https://api.instagram.com/oauth/authorize,否则它会立即指向我的重定向网址,所以我无法获取访问令牌。这里是我的代码:instagram登录hello.js

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

您是否找到解决方案? – Manolo

回答

0

我发现,我不得不改变response_typetoken

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

现在它为我工作。