I am using angularJs and rending a button to let user authorize to instagram.
I can test by passing https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token iI get the accessToken in the redirectUrl.
The question is how do I invoke this flow in angularJs button click. Currently what I have is as follows:
html
Authorize to Instagram
js
app.controller('AdminController', ['$scope', function($scope){
...
this.authorizeIg = function(){
console.log('start of authorizeIg implict flow');
window.location.href = "https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token";
};
The above will just redirect me to redirect_url after authentication. So, I do not know how to invoke that url within the function and return back a response containing accessToken