mediawiki/oauthclient
PHP client library for MediaWiki OAuth 1.0a authentication. Handles the three-legged handshake, signed API requests, and token management, letting your tool act on behalf of wiki users across Wikimedia and other MediaWiki sites.
Architecture fit
Extension:OAuth, plus an identify call to resolve the authenticated wiki user (username, blocked flag). Exposed surface is small and stable: ClientConfig, Client, Consumer, Token, User.Integration feasibility
MediaWikiOAuthService resolved from the container, a config/mediawiki-oauth.php for consumer key/secret and wiki base URL, and two controller actions. The real work is the OAuth 1.0a request-token secret: it must survive a browser redirect, so it belongs in a shared session/cache store — not a per-node in-memory or file session — or the callback fails intermittently behind a load balancer.oauth extension. That is not in stock php:fpm images and must be added to every Dockerfile/AMI, including CI and local dev. Budget for that explicitly; it is the most common "works on my machine" failure.Special:OAuthManageMyGrants), and a re-auth prompt when identify returns 401.Technical risk
^8.x support and possible deprecation noise (dynamic properties, implicit nullable parameters). A one-day compatibility spike on our target PHP version is mandatory before committing.Key questions
oauth extension across all environments, including managed hosting or PaaS where we cannot install PHP extensions?Stack fit
oauth, not Laravel.WikiAuthContract) from day one. That is what makes the eventual OAuth 2.0 migration or a fork a swap rather than a rewrite.Migration path
getAuthorizationUrl(), completeAuthorization(), identify(). Keep those three methods free of OAuth 1.0a types so the implementation can change without touching controllers.Compatibility
identify response.php constraint blocks install, use a composer.json platform override only after the runtime spike passes, or vendor-fork under our namespace and drop the guard.Sequencing
Special:OAuthConsumerRegistration, complete handshake from a Laravel route on target PHP, confirm identify returns the expected user payload. This answers compatibility, protocol availability, and extension availability in one pass.WikiAuthContract implementation, encrypted token model and migration.maxlag, and error taxonomy handled centrally.Maintenance
Support
Scaling
maxlag compliance for write-heavy usage — Wikimedia applies per-consumer limits and will throttle or block abusive consumers.Failure modes
mwoauth-invalid-authorization. Needs NTP discipline and a clear error message rather than a generic 500.identify returns 401; must trigger re-consent, not a dead end.Ramp-up
How can I help you explore Laravel packages today?