Login with hello.js

I tried to login using hello.js but never referenced https://api.instagram.com/oauth/authorize , otherwise it redirects my redirect url right away, so I can't get the access token. 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
    });

      

+3


source to share


1 answer


I found that I had to change response_type

to token

:

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

      



Now this works for me.

0


source







All Articles