Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Guzzle Oauth2 Subscriber Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for outbound OAuth 2.0 plumbing: Use this package instead of writing custom Guzzle middleware to acquire, attach, refresh, and retry OAuth 2.0 tokens. The package is a focused infrastructure utility, not a product differentiator. Unchanged by v1.1.1.
  • Third-party integration roadmap: Supports integrations where our Laravel/PHP backend calls external APIs using OAuth 2.0—CRM, marketing automation, analytics, support platforms, data providers, or partner APIs—especially when those providers do not offer a first-party PHP SDK.
  • Multi-tenant token handling: The Guzzle subscriber model can be paired with application-specific token storage, enabling per-tenant or per-user token persistence without embedding provider-specific auth logic throughout the codebase.
  • Legacy and mixed-version portfolio decisions: The package advertises Guzzle 4–7 and PHP 5.4–8.0 compatibility, making it relevant for older Laravel/PHP services that cannot immediately standardize on the newest HTTP client stack. v1.1.1 additionally clears nullable deprecations on PHP 8.4+, which modestly widens the practical runtime window—but it does not constitute a formal PHP 8.1+/Laravel 10+ support commitment.
  • Scope control: It helps us decide not to build a bespoke OAuth client for every integration. It also clarifies what remains out of scope: user login/social auth, OAuth provider functionality, OpenID Connect, and provider-specific business logic.
  • Risk management: Because the package has a small community footprint, we should decide whether to use it directly or wrap it behind an internal OAuthHttpClient/token-provider abstraction so we can replace it later without rewriting integrations.
  • Maintenance-signal tracking (updated): v1.1.1 is a narrow patch from a first-time contributor, indicating the project still accepts outside fixes. Treat this as a positive but weak signal of upkeep—it is not evidence of a roadmap, security response process, or modern-framework investment. Keep the internal-wrapper decision in place.

When to Consider This Package

Consider it when:

  • The application already uses Guzzle for outbound HTTP and needs OAuth 2.0 token acquisition and refresh at the request layer.
  • We need standard OAuth 2.0 client behavior—such as client credentials, authorization code, password, or refresh-token flows—with pluggable token storage.
  • We want a small, MIT-licensed, framework-agnostic utility rather than a full OAuth server or provider SDK.
  • The integration surface is limited and the team can pin the package version, test it in our PHP/Guzzle matrix, and wrap it behind internal interfaces.
  • We are maintaining a legacy Laravel/PHP service where broad Guzzle compatibility is more important than Laravel-native ergonomics.
  • We are running (or evaluating) PHP 8.4 and want to avoid nullable-deprecation noise; v1.1.1 specifically addresses this, so it is the minimum version to pin if 8.4 is in scope.

Look elsewhere when:

  • The application is a modern Laravel app that can use the Laravel HTTP client with custom middleware or a provider’s official SDK. Laravel-native tooling may be simpler and better supported.
  • The need is user authentication or social login, where Laravel Socialite is the more appropriate choice.
  • We need OpenID Connect, PKCE-heavy flows, advanced grant types, or a richer OAuth 2.0 client abstraction; evaluate league/oauth2-client or provider SDKs.
  • We require formal support, security certifications, a large maintainer base, or guaranteed compatibility with PHP 8.1+/Laravel 10+. The PHP 8.4 deprecation fix in v1.1.1 does not change this: there is still no published support matrix or CI guarantee for modern Laravel versions.
  • The integration is business-critical and the package’s maintenance, release cadence, and PHP 8.1+ support have not been validated.

How to Pitch It (Stakeholders)

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk