Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Instagram oAuth returning "No matching code found" on one server

I'm currently receiving

{"code": 400, "error_type": "OAuthException", "error_message": "No matching code found."} 

while attempting to get a user's access token on one of our servers. This is occurring while using the REST Client Chrome extension and from our web application, on one particular server.

I am able to receive the user's access token from my local machine and a different server using the same code and extension.

Could our IP have been blacklisted from receiving access tokens? Has anyone else run into this issue?

Thanks,

EDIT

Heard back from Instagram support, this was an issue on their end and has been fixed. Thanks for the help.

like image 306
Richard Mosley Avatar asked Apr 29 '15 19:04

Richard Mosley


3 Answers

Yes your intuition is correct. It is likely that you made too many incorrect API calls that Instagram disabled your IP. I started dealing with Instagram API this week, at the beginning it was working but today I started getting the same error you got. The code also works fine locally or on any other machine. The only explanation to this is that my IP is blocked. Just switch your IP and you should be fine!

like image 147
Hans Ziqiu Li Avatar answered Oct 23 '22 12:10

Hans Ziqiu Li


SOLVED: The reason for this error is the ip address from which you are trying to connect to Instagram and get access_token. After contacting my network provider and changing my ip everything got fixed.

To figure out if your issue is caused by your local ip (not the server ip) try to connect to your app via mobile network or any other network different from yours: - If it works you need to change your local ip. -If it does not work - change your server ip cause it is probably banned by instagram for lots of malicious requests.

like image 24
4 revs Avatar answered Oct 23 '22 11:10

4 revs


I was having the same trouble: users couldn't authenticate through Instagram and the error returned was "OAuthException" and "No matching code found." Started on 4/28/15 but didn't catch until two days later. Only in production, not staging, so it was almost certainly IP.

I posted to the Instagram developer help center (https://help.instagram.com/contact/438525166257277) yesterday at 7pm and the problem was fixed by this morning, with a cryptic email from their support at 11am ("The issue has been resolved").

like image 1
lydiat Avatar answered Oct 23 '22 12:10

lydiat