Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Oauth2 Instagram

Oauth2 Instagram Laravel Package

league/oauth2-instagram

Instagram OAuth 2.0 provider for the League OAuth2 Client. Adds Instagram authorization and token handling to PHP applications so you can authenticate users and access Instagram APIs with minimal setup.

View on GitHub
Deep Wiki
Context7

league/oauth2-instagram is a PHP OAuth 2.0 provider client for authenticating users with Instagram. Part of the League OAuth2 ecosystem, it integrates seamlessly with league/oauth2-client to handle the full authorization code flow, letting your Laravel or plain PHP application obtain access tokens and fetch user profiles from the Instagram API.

  • Implements Instagram's OAuth 2.0 authorization code grant
  • Simple, framework-agnostic integration via league/oauth2-client
  • Configurable scopes, redirect URI, and token handling
  • Access to Instagram user data through standard API calls
  • PSR-compliant, well-tested, and actively maintained
Frequently asked questions about Oauth2 Instagram
How do I install league/oauth2-instagram in a Laravel app?
Run composer require league/oauth2-instagram. It pulls in thephpleague/oauth2-client as its real dependency and ships no Laravel service provider, facade, or config file, so you instantiate the provider yourself. Put that instantiation in a dedicated auth service class rather than a controller. Check the resolved oauth2-client version first, because a 2020-vintage package is likely pinned to ^2.0.
Does league/oauth2-instagram work with Laravel 10 and Laravel 11?
There is no Laravel-specific integration to break, so compatibility depends almost entirely on your PHP version and the oauth2-client constraint. The package is framework-agnostic and was last released in February 2020, with no CI evidence for PHP 8.2, 8.3, or 8.4. Test an install and a live auth round-trip on your target runtime before committing to it.
Is league/oauth2-instagram still maintained?
No. The last release was 2020-02-25, it has roughly 66 stars, a single-maintainer history, and no dependents in this dataset. There are no recent commits and no demonstrated response to oauth2-client v3. Treat it as an abandoned but MIT-licensed artifact: usable, unsupported, and yours to fork if you adopt it.
Does league/oauth2-instagram work with the current Instagram API and Instagram Login?
Probably not out of the box. The provider was written in the era of the legacy Instagram API Platform and Basic Display API, so it almost certainly hardcodes api.instagram.com authorize and token endpoints and a simple id plus username resource owner. Meta has since consolidated on Instagram API with Instagram Login and Facebook Login for Business. Verify a live authorization round-trip against a properly configured Meta app before trusting any estimate.
How do I get a long-lived 60-day Instagram access token with this package?
The provider likely only implements the short-lived authorization code exchange. Long-lived token extension against graph.instagram.com, refresh, and revocation are probably not modeled. You would need to call those endpoints yourself or extend the provider with a custom method. Confirm the current token lifecycle in Meta's docs before designing around it.
Can I use league/oauth2-instagram with Laravel Socialite?
Not directly. Socialite requires a Socialite-compatible driver, typically a community socialiteproviders wrapper, which adds another unmaintained layer on top of an already stale package. Using league/oauth2-client directly behind your own service class keeps the dependency graph shallower and easier to replace.
How do I stop league/oauth2-instagram vendor code from leaking into controllers?
Define a small internal interface such as InstagramAuthProvider with methods for the authorization URL, token exchange, and user profile, then implement it with the League provider in one service class. Controllers and models depend only on your interface. That wrapper is the entire mitigation strategy: it turns an abandoned vendor package into a replaceable internal detail whose replacement cost is roughly a day of work.
What are the alternatives to league/oauth2-instagram?
You can fork the provider and own it, which is usually the pragmatic choice given how small the Instagram-specific surface is. You can write a custom AbstractProvider against league/oauth2-client yourself, or use a community Socialite driver if you already lean on Socialite. Meta's official SDKs are another route if you are comfortable leaving the PHP League ecosystem.
Will league/oauth2-instagram cause a Composer conflict with oauth2-client v3?
Likely yes. A provider released in 2020 is probably constrained to oauth2-client ^2.0, which conflicts with applications already on v3. Run composer why-not thephpleague/oauth2-client to confirm the constraint before planning anything. If you need v3, plan on a fork with a widened constraint and a tested upgrade path.
What should I verify before using league/oauth2-instagram in production?
Confirm a live authorization round-trip succeeds today against a configured Meta app and which login product it targets. Check which oauth2-client major versions are supported, how long-lived tokens are obtained and refreshed, and whether getResourceOwner matches the current user payload. Also test scope customization for instagram_business_manage_* permissions, data-deletion callbacks, and PHP 8.3 and 8.4 compatibility, and decide in advance what your fallback is if Meta changes the flow again.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console