fix(social-auth): restore Instagram OAuth scopes for pages, insights and comments#88
Open
dvlexp wants to merge 1 commit into
Open
Conversation
…ents Replaced legacy scope set (instagram_basic + content_publish + publish_video) with the Meta Graph v18+ recommended set: - pages_show_list - pages_read_engagement - instagram_manage_insights - instagram_manage_comments Older scopes were rejected by the new Meta app review flow. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the Instagram OAuth connection flow to request the new, Meta Graph v18+–compliant set of permissions so that analytics and engagement tracking continue to work without scope errors. Sequence diagram for updated Instagram OAuth scope usagesequenceDiagram
actor User
participant AppBackend as AppBackend(connect)
participant InstagramOAuth as Instagram_OAuth_Server
User->>AppBackend: GET /auth/instagram/connect
AppBackend->>AppBackend: connect()
AppBackend->>AppBackend: _callback_url()
AppBackend->>AppBackend: urlencode(scope="pages_show_list,pages_read_engagement,instagram_manage_insights,instagram_manage_comments")
AppBackend-->>User: 302 Location: https://www.facebook.com/v18.0/dialog/oauth?...
User->>InstagramOAuth: Open authorization URL with new scopes
InstagramOAuth-->>User: Consent screen for pages and insights permissions
User-->>InstagramOAuth: Approve requested scopes
InstagramOAuth-->>User: Redirect to callback_url with code and state
User->>AppBackend: GET callback_url?code=...&state=...
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider extracting the scope list into a named constant (or helper) so future Meta permission changes can be updated in one place and better documented in code.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the scope list into a named constant (or helper) so future Meta permission changes can be updated in one place and better documented in code.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Instagram OAuth flow was using a legacy scope set (
instagram_basic,instagram_content_publish,publish_video) that is no longer accepted by the Meta app review process for the Graph API v18+. This caused the OAuth authorization to fail for analytics and engagement tracking features.Solution
Replace the legacy scope set with the Meta Graph v18+ recommended permissions:
instagram_basicpages_show_listinstagram_manage_insightspages_read_engagementpages_show_listinstagram_manage_insightsinstagram_content_publishinstagram_manage_commentspublish_videoFiles Changed
social-auth/auth/instagram.py— single-line scope string updateTest Plan
make social-auth/me/media,/me/insights) return data after authorizationSummary by Sourcery
Update Instagram OAuth scope set to align with Meta Graph API v18+ requirements for analytics and engagement features.
Bug Fixes:
Enhancements: