FB: System user access token don't have scope delegated from configuration from FB login for Business flow

291 Views Asked by At

Steps I followed:

  • Create app
  • Add FB login for Business product in your app
  • Create config with permission & asset I selected - Adaccount, Page, Pixel
Javascript SDK
window.FB.login(
(response) => {
 if (response && response.authResponse && response.authResponse.accessToken) {
    console.log("################")
    console.log(response);
    console.log("################")
 }
},
{
   config_id: 'your_id', // configuration ID goes here
   response_type: 'code',   // must be set to 'code' for SUAT
   scope: 'business_management,ads_management,pages_read_engagement', // passing extra, tired      without passing as well
   return_scopes: true
}
);

On click of a button This will open a authentication pop-up. Post authentication: I get access_token(System user) as well as code.

Now as per documentation

Path 1: I'm suppose to use code through which I can get token, BUT getting error redirect_uri doesn't match.

&

Path 2: If I debug access_token from response debug access_token

Scopes I set in configuration settings are not set/delegated to system user.

Following are my configurations: Following are my configurations Response

Aim is to have access_token of system user so that I can run cron jobs to publish ads.

0

There are 0 best solutions below