Facebook Graph API and instagram scopes

Hello, I need to implement a social login using the Facebook Graph API to access the instagram business data user. For this is necessary to use the instagram_basic scope. I couldn’t find that scope in the Facebook social connection.

Is there any possible way to use that scope when using the Facebook social connection?

Thanks!

EDIT: I found this documentation Instagram Connection Deprecation that points to the new Instagram Graph API but I think that is wrong because is using the old Instagram API because I’m having a 400 client id error.

1 Like

Hey there,

As fas as I know both changes to the stack as well as the docs been made to reflect the newest Facebook and Instagram APIs. Let me check that and get back to you soon!

2 Likes

hello!
How 's going?
I got same problem too…
Is there any solution for adding ‘instagram_basic’ scope ?

I found out the articles below.

but,I cant apply the artcle for the solution.
Thanks.

Hi @komatsu, yes the problem is that the social connection for Facebook does not havethe “instagram_basic” scope. I ended up using the “Custom Social Connection” extension. You will have to create a new connection like the following:

Name: “Just a name for the new connection”

Client ID: “The client ID from Facebook Graph”

Client Secret: “The client secret from Facebook Graph”

Authorization URL: https://www.facebook.com/dialog/oauth?client_id={CLIENT-ID-FB}&redirect_uri={OKTA-DOAMIN}/login/callback

Token URL: https://graph.facebook.com/oauth/access_token?client_id={CLIENT-ID-FB}&redirect_uri={OKTA-DOAMIN}/login/callback&client_secret={CLIENT-SECRET}

Scopes: public_profile,instagram_basic (feel free to add what you need here)

Fetch User Profile Script: (This is to fetch user information after the login process I’m using this)

function(access_token, ctx, callback) {
  request.get('https://graph.facebook.com/me?fields=id,name,picture&access_token=' + access_token, {
    'headers': {}
  }, function(e, r, b) {
    if (e) {
      return callback(e);
    }
    if (r.statusCode !== 200) {
      return callback(new Error('StatusCode:' + r.statusCode));
    }
    var profile = JSON.parse(b);
    callback(null, {
      user_id: profile.id,
      name: profile.name,
      picture: profile.picture.data.url
    });
  });
}
1 Like

@m3ld
thank you for your great advice!
I will try the solution.
Thank you so much!

Let us know Komatsu if you’ll have any questions!

@konrad.sopala
Hello,I implement this code above.

but I cannot implement ‘auth_type=reauthenticate’ below
Authorization URL: https://www.facebook.com/dialog/oauth?auth_type=reauthenticate

How can I display an authenticate popup window like built in FBlogin using “Custom Social Connection” extension?

Thank you.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.