Inconsistent Permissions Issue with Facebook API v20
I've encountered a problem with my application in Live mode. I've conducted several tests with various Facebook pages and Instagram accounts, always following the same process, but I'm getting inconsistent permissions.
I use facebook api v20.
Problem Details
- In most cases, I successfully obtain all the required permissions.
- In some instances, I can't get the
pages_show_list
permission. - The error occurs only with certain accounts, but I can't identify what distinguishes these accounts from the others.
Current Implementation
I'm requesting the following permissions:
instagram_basic
instagram_manage_insights
business_management
pages_show_list
pages_read_engagement
All permissions are successfully approved by facebook.
I use the following URL for authentication:
const url = `https://www.facebook.com/dialog/oauth?client_id=${CONFIG.FACEBOOK_APP_ID}&extras={"setup":{"channel":"IG_API_ONBOARDING"}}&redirect_uri=${CONFIG.BACKOFFICE_URL}/instagram&response_type=token&scope=instagram_basic,instagram_manage_insights,business_management,pages_show_list,pages_read_engagement`
Encountered Error
When testing the user-generated accessToken in the Facebook API Graph Tester, I receive the following error, but only for some accounts:
"The "accounts" field is only accessible on the User object after the user has granted one of the following permissions: 'pages_show_list'."
Questions
- How is it possible that this inconsistency in permissions occurs?
- Could it depend on some specific configuration of the Facebook page in question?
- What might be distinguishing the accounts that encounter this error from those that don't?
- Are there alternative solutions or approaches to ensure consistent obtaining of all required permissions?
Any help or suggestions to understand and resolve this issue would be greatly appreciated. Thank you in advance for your support.