Search code examples
androidoauthinstagramfacebook-oauthinstagram-api

Instagram API OAuth & Endpoints update 04-30-2015


After a major Instagram API lots of instagram-based apps started to get access_token errors for all users that try to log in (tried to create new instagram client - didn't work) I'm using Thiago Locatelli & Lorensius W. L T android-instagram-omniauth https://github.com/thiagolocatelli/android-instagram-oauth

according to their code I get this error "Failed to get access token"

Here is the code:

    static int WHAT_FINALIZE = 0;
    static int WHAT_ERROR = 1;
    private static int WHAT_FETCH_INFO = 2;

...    

    private Handler mHandler = new Handler() {
    @Override
    public void handleMessage(Message msg) {
        if (msg.what == WHAT_ERROR) {
            mProgress.dismiss();
            if (msg.arg1 == 1) {
                mListener.onFail("Failed to get access token");
            } else if (msg.arg1 == 2) {
                mListener.onFail("Failed to get user information");
            }
        } else if (msg.what == WHAT_FETCH_INFO) {
            // fetchUserName();
            mProgress.dismiss();
            mListener.onSuccess();
        }
    }
};

I think it may be the same issue as stated here: Instagram oAuth returning "No matching code found" on one server

UPDATE: This issue may be fixed by changing your server ip adress, but there are not enough information on how should Instagram app be configured (does it have "Enforce signed requests" or "Disable implicit OAuth" enabled, etc.)

Does the WEBSITE_URL setting in the Instagram client app tell instagram about your server IP?

BTW, right now when you try to save instagram client app's settings you get "Sorry, an error occurred while processing this request" that should mean some internal changes are being implemented right now...

Thanks a lot, mates!

SOLVED:

The issue was solved by changing my local IP (I contacted my IS provider and changed IP to a different one). Probably Instagram blocked my previous shared IP for lots of requests so switching to a new one worked for me. Try to connect from mobile network (or any other network different from yours) if there is no error - you need to change your local ip. If the error persists - the reason might be your server IP


Solution

  • SOLVED

    Changing my local IP address fixed the issue (I contacted my IS provider and changed IP to a different one).

    Instagram has protection system that can block IP address (usually shared one) for too many requests. So if you have similar issue, just switch to a new IP address.

    If you are not sure if your local IP address is the case, just try to connect from your mobile phone using GSM network (or any other network that is different from yours) and if there is no error using different IP - you need to change your local IP. Otherwise - the reason might be your server IP