dormilich/http-oauth
PSR-compatible OAuth2 Client Credentials extension for dormilich/http-client. Automatically fetches and caches access tokens via a token client/provider, then adds Authorization headers to outgoing requests. Works with PSR-18/17 HTTP clients and PSR-16 cache.
ChainProvider.Adopt when:
Look elsewhere if:
Guzzle/Http stack.For Executives: "This package lets us securely connect our backend services to third-party APIs (e.g., payment processors, analytics) using OAuth2’s Client Credentials flow—without building or maintaining custom auth logic. It’s lightweight, standards-compliant, and reduces risk by handling token refresh automatically. For example, we could use it to authenticate our Laravel-based order service with Stripe and Twilio APIs under one roof, with minimal dev overhead."
For Engineering:
*"This is a PSR-compliant, dependency-injection-friendly extension for dormilich/http-client that adds OAuth2 Client Credentials support. Key benefits:
Http facade).ChainProvider to switch credentials per domain (e.g., api.stripe.com vs. internal-api.example.com).league/oauth2-client.
Tradeoff: Limited to Client Credentials only—ideal for backend services but not user-facing auth."*For Architects: *"This solves a specific, high-value niche: secure API-to-API communication with minimal abstraction. It’s a composable building block for:
Cache facade for PSR-16 compliance."*How can I help you explore Laravel packages today?