xmrcivicboix
Re:Ask HN: Does anyone else have problems with Instagram API OAuth2?
on Sunday December 18, 2016 @10:43AM (#13206151)
Unfortunately, Instagram is terrible with responding to developer support tickets and there really isn't a much of a community aspect around it. This issue itself is not easily reproducible. The same account may work on one site and not a another site.
Re:Ask HN: Does anyone else have problems with Instagram API OAuth2?
on Saturday December 17, 2016 @09:36PM (#13204007)
When you generate the server side explicit flow, it looks something like this:
https://api.instagram.com/oauth/authorize/?client_id=CLIENT-...
Depending on the library you use, it may be default to response_type=code. Just get the URL and do a search and replace if the library doesn't allow you to define the type.
Re:Ask HN: Does anyone else have problems with Instagram API OAuth2?
on Saturday December 17, 2016 @07:30PM (#13203614)
I completely agree. Hence I said it's temporary. When you have a huge influx of paying customers who cannot log in to do their work, you have to balance that a bit.
Re:Ask HN: Does anyone else have problems with Instagram API OAuth2?
on Saturday December 17, 2016 @10:52AM (#13201093)
To temporary fix the issue, you could do the following:
change response_type=code to response_type=token. Instagram will redirect back to your site with something like /callback#access_token=123456. From here, send the user to a very simple page with the following snippet:
<script>
if (window.location.hash && window.location.hash.indexOf('#access_token=') !== -1) {
var accessToken = window.location.hash.replace('#access_token=', '');
window.location = '/callback?access_token=' + accessToken;
}
</script>After that, you just use the Instagram API to retrieve user by access token then perform log in. This is not a recommended flow by Instagram but is a flow that works for now if your customers are constantly hammering you with support tickets as they did with us.