Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OAuthException error_message: "Invalid scope: []" What am I doing wrong?

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.

like image 490
Егор Баклач Avatar asked Oct 17 '19 06:10

Егор Баклач


1 Answers

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.

like image 125
Nobody Avatar answered Dec 14 '22 21:12

Nobody