taavi/laravel-socialite-mediawiki
A Laravel Socialite provider that lets users sign in to your application with their MediaWiki account, adding MediaWiki OAuth support to Socialite's familiar redirect and callback flow.
Architecture fit. This is a thin adapter, not a platform: a Laravel Socialite driver that maps MediaWiki's OAuth 2.0 endpoints onto Socialite's AbstractProvider contract and returns a standard Laravel\Socialite\Contracts\User. It slots into the existing Auth/Socialite layer without touching domain code, which keeps architectural blast radius small and makes the build-vs-adopt decision genuinely reversible. Fit is strongest where MediaWiki/Wikimedia identity is a primary IdP — Wikimedia-adjacent tooling (event dashboards, edit-a-thon sign-ups, campaign trackers), Toolforge front-ends, chapter/affiliate sites, internal wiki companion apps — or a deliberate secondary login alongside email/password. It is a poor fit as a generic "add a social login" package, because the addressable user base is anyone with an account on one specific wiki or wiki farm.
Integration feasibility. Mechanically trivial on the Laravel side: composer require, a credentials block in config/services.php, two routes, one controller. The real effort is wiki-side OAuth consumer registration through Special:OAuthConsumerRegistration, which yields client ID/secret and requires an exact callback URL match (scheme, host, port, trailing slash). As a TPM, plan the ticket around consumer registration and OAuth app governance, not PHP — that is where the calendar time goes, and it involves an external approver (a wiki bureaucrat) we do not control.
Technical risk. The risk profile is dominated by project health rather than code quality:
composer audit only sees the package if it is on Packagist and an advisory is filed through Packagist's feed.AbstractProvider signatures across 5.x → 6.x (Laravel 11/12 era). Small packages like this frequently lag; verify the composer.json constraint range before committing to it inside a supported Laravel release.sub, username, and groups — not email. On Wikimedia wikis, local user IDs are per-wiki; the stable cross-wiki identifier is the CentralAuth ID. Keying users on the wrong field creates duplicate accounts that are painful to merge later, and that is a product-data problem, not just a code one.Key questions to close before committing.
git.sr.ht? This drives CI availability and supply-chain exposure to a single forge.sub vs CentralAuth ID)?Stack fit. Standard Laravel plus Socialite. No new runtime dependencies beyond laravel/socialite, no migrations, no service-container gymnastics. The only compatibility gate is the package's PHP constraint against our pinned PHP version and the Socialite version implied by our Laravel release.
Migration path. Additive, not a migration — there is no existing flow to displace. The one structural decision that matters: persist external identity in a dedicated social_identities table (user_id, provider, provider_user_id, raw_payload, timestamps) with a unique index on (provider, provider_user_id). That decouples our user model from this package and makes an IdP swap, or our own fork, a data-only change. Do not overload users.email — it will not be populated by this provider.
Compatibility. Three surfaces to verify: (a) Socialite major version against the package's declared constraint, (b) our wiki's MediaWiki/OAuth extension version and whether OAuth 2.0 is enabled, and (c) the consumer's registered callback URLs per environment. Staging and production need separate consumers or separately registered callbacks; this is the most common go-live failure and should be an explicit checklist item, not tribal knowledge.
Sequencing.
InvalidStateException and provider Throwables, rate limiting on the redirect route.Maintenance. Assume we own it. Budget a small recurring allotment: review on each Socialite major (roughly annually) plus a re-test when the target wiki upgrades its OAuth extension. Because there is no upstream community, "wait for a fix" is not a viable strategy — the fork is the strategy, and it should be staffed as such from day one rather than discovered in an incident review.
Support. No vendor, no GitHub issues, no Stack Overflow corpus. Internal documentation of the consumer registration process — who holds the secret, how it is rotated, which wiki bureaucrat approves consumers, what the exact registered callback URLs are — will be worth more than any code comment. Secret rotation is a manual, on-wiki operation with no API; assign a named owner and record it in the runbook.
Scaling. Negligible. This sits on the login path only: low QPS, no heavy computation, no caching concerns. Throughput ceilings, if any, come from the wiki's OAuth endpoints, not from us. Do not let it consume capacity-planning attention it does not deserve.
Failure modes to instrument. Each of these is a login-path outage, so the login callback failure rate should carry an alert rather than relying on user reports:
AbstractProvider signatures — fatal at container resolution.git.sr.ht unavailability breaking composer install in CI, if consumed via VCS repo rather than Packagist.sub that duplicates across wikis.Ramp-up. Low. A Laravel developer with Socialite experience is productive in half a day. The wiki-side OAuth consumer process is the only unfamiliar territory and is a documented, one-time administrative task — worth pairing with whoever owns the wiki relationship, since that is the piece that will otherwise stall the ticket for a week while engineering waits on an external approver.
Bottom line for stakeholders. For a narrowly defined but valuable audience — people who already hold wiki accounts — this is a low-cost way to remove a signup barrier and meet users where they are. It is a contained integration, not a platform bet: if it does not work out, we can replace it without touching the rest of the product, provided we keep it behind our own auth abstraction and identity table from the start. What we are buying is days of engineering saved; what we are paying is a small permanent maintenance obligation and the diligence of the spike. Approve the spike, budget the fork, and gate the wider rollout on the identity-keying question being answered.
How can I help you explore Laravel packages today?