socialiteproviders/zalo
Zalo OAuth provider for Laravel Socialite, letting you add Zalo login to your app with a simple driver. Install via Composer, configure your app ID and secret, then authenticate users through Zalo’s OAuth flow alongside other Socialite providers.
Architecture fit
socialiteproviders/zalo is a thin Laravel Socialite driver, not a standalone auth system. It registers a zalo driver with Socialite's existing registry via a SocialiteWasCalled listener, so it composes with an existing laravel/socialite install rather than replacing it. For any Laravel app already using Socialite for Google/Facebook/Apple, this is the lowest-friction path to "Log in with Zalo."Socialite::driver('zalo')->user()). It fits a conventional MVC, Inertia, or Livewire monolith. It is not a fit for a pure SPA or native mobile token-exchange flow without a backend-for-frontend, and it is not an API-to-API auth library.Integration feasibility
config/services.php block, one controller pair. A competent Laravel developer can stand this up against a Zalo developer app in well under a day.Technical risk
laravel/socialite major requirement, renamed config/scope keys, or adaptation to a Zalo Open API version change. Do not approve 5.0.0 until the diff is read.laravel/socialite ^5.x (which implies PHP 8.2+), that cascades into the host app's Laravel and PHP versions. A "small auth feature" can quietly become a framework upgrade. Determine this before any commitment.provider_user_id links break and users get duplicate accounts on next login. This is a data-integrity risk, not just a code risk, and it argues for staging validation against real linked accounts.SocialiteProviders/Providers). Long-term availability and responsiveness to Zalo API changes are not guaranteed.users table requires a non-null unique email, a subset of registrations will fail silently. Design decision needed up front.Key questions (decision gates before approval)
laravel/socialite versions? Does 5.0.0 force a framework upgrade, and is that in scope?email at all for our approved app? If not, what is the fallback identity for the local user record?Stack fit
laravel/socialite. If Socialite is not yet present, adding it is its own small decision with its own version constraints and should be scoped separately.laravel/socialite ↔ socialiteproviders/zalo 5.0.0) must be written into the internal runbook. Otherwise the next framework upgrade rediscovers it expensively.Migration path
^5.0 once the constraint check passes. No reason to start on 4.x.composer.json, upgrade on a branch, run the full OAuth round trip against a Zalo test app, and explicitly verify the persisted provider user-ID mapping is unchanged before touching production. A changed ID field silently orphans account links.^4.1 remains a legitimate short-term hold provided it is confirmed functional against Zalo's current API. Pin it and document why — an undocumented pin becomes tribal knowledge.Compatibility
@internal; that is the usual breakage point on a Socialite major.ZALO_REDIRECT_URI driven entirely from env. Redirect URI matching is character-for-character, including trailing slashes — the single highest-frequency first-run failure and a recurring source of "works on my machine" support tickets.Sequencing
services.php config, redirect + callback controller — behind a feature flag.Maintenance
Support
SocialiteProviders/Providers repo. Internal support burden concentrates almost entirely in the callback path, which is where users hit the flow.Invalid state / error=access_denied in query — catch it and flash a message rather than 500), unapproved scope requests, and missing email. This converts predictable 500s into handled UX and cuts on-call noise.Scaling
access_token, refresh_token, and a derived expires_at, and refresh explicitly before any subsequent API call. If the scope is login-only, this barely matters — if Zalo APIs get added later, it matters a lot.Failure modes
InvalidArgumentException or an error query param. Unhandled, this is a 500 for a completely normal user action.email is nullable or synthesize a fallback.Ramp-up
Socialite::driver('zalo') and nothing more. A Laravel developer unfamiliar with Socialite needs a few hours to read the redirect/callback pattern.How can I help you explore Laravel packages today?