5

First of all... I want to integrated authentication in my App for anyone Instagram users by oAuth.

After readed guide https://developers.facebook.com/docs/instagram-basic-display-api/getting-started, I added myself into Instagram Test User and then no have any problems to get token, user_id and carry out some actions into my App. But if I can do it by anyone Instagram users without my Instagram Test User, I get OAuthException with 400 status and error_message: "Invalid scope: []" on oauth/access_token method

For example, step-by-step:

  1. Getting Instagram Authorization Form, write username, password https://api.instagram.com/oauth/authorize?app_id={app-id}&redirect_uri={redirect-uri}&scope=user_profile&response_type=code&state={state}

  2. Then I would like to Exchange the Code For a Token. Send POST request https://api.instagram.com/oauth/access_token by data app_id={app-id}&app_secret={app_secret}&grant_type=authorization_code&redirect_uri={redirect_uri}&code={code} Parameter "code" getting from step 1.

  3. And now I have token and user_id by JSON response after finished step 2.

So, If I carry out by my Instagram Test User I don't have any Exceptions, but If I can do it by another Instagram user, write other username, password on step 1, I'll get OAuthException

PS. I thought the API Instagram Basic Display product on my Facebook Application was probably not moderated by any competence developer. I sended statement, and received refusal: "Instagram profile permissions should not be used to authenticate new users in your app". So, What I am doing wrong?

UPD. On step 1, If i could make to log in distinctive username, password by another Instagram user, I don't receive the "code" - necessary parameter on step 2.

  • 1
    You need to submit your app for review, before you can ask users that don’t have a role in the app for those permissions - https://developers.facebook.com/docs/instagram-basic-display-api/overview#app-review – 04FS Oct 17 '19 at 08:48
  • And if you already tried that, and in response they told you, _“Instagram profile permissions should not be used to authenticate new users in your app”_ - well, then you probably need to change your concept. Apparently they don’t want you to use this API to create any new accounts in your app, but rather that you connect already existing user accounts with their IG profile. – 04FS Oct 17 '19 at 08:51

1 Answers1

7

If your app is still in Development Mode, then you have to add Instagram users in My Apps > Roles > Instagram Testers. And those Instagram Users have to Accept the Tester Invite.

Nobody
  • 101
  • 1