kamermans/guzzle-oauth2-subscriber
Guzzle OAuth2 Subscriber adds OAuth 2.0 authorization to Guzzle HTTP clients in PHP. It provides middleware for authorization code, client credentials, password, and refresh token grants, automatically attaching and refreshing access tokens on outgoing requests.
OAuthHttpClient/token-provider abstraction so we can replace it later without rewriting integrations.Consider it when:
Look elsewhere when:
league/oauth2-client or provider SDKs.Executive summary: This is a small MIT-licensed utility that reduces custom OAuth 2.0 plumbing for Guzzle-based integrations. It can shorten delivery time for third-party API integrations and lower maintenance cost by centralizing token refresh behavior. It is not a strategic differentiator and should be treated as replaceable infrastructure. The latest release (v1.1.1) is a minor compatibility patch that fixes nullable deprecations on PHP 8.4+; it carries no breaking changes or new features, so it does not alter the business case. Approve it for low-risk integrations or a time-boxed spike, with an internal wrapper to limit lock-in and a compatibility check for our PHP/Laravel baseline.
Engineering summary: The package provides a Guzzle subscriber for OAuth 2.0 token handling across Guzzle 4–7 and older PHP versions. It is useful where we already depend on Guzzle and want token acquisition/refresh without building custom middleware. v1.1.1 contains a single fix (PR #62) for nullable deprecations under PHP 8.4+, contributed by a first-time contributor—low blast radius, but also no signal of broader modernization. Risks remain the small community footprint and unclear fit for modern PHP 8.1+/Laravel versions. Recommended approach: pin to v1.1.1 or later, run the upgrade as a routine dependency bump (no code changes expected), add integration tests against our target providers, isolate it behind an internal client abstraction, and avoid using it for user login or as an OAuth provider.
How can I help you explore Laravel packages today?