guzzlehttp/oauth-subscriber
Guzzle middleware that signs HTTP requests with OAuth 1.0. Compatible with Guzzle 7.10+ and PHP 7.2.5+. Configure consumer/token secrets once on a HandlerStack, then enable per request (auth=oauth) or globally, with optional per-request token override.
HttpClient facade or custom Guzzle instances.HttpClient (Guzzle 7+) or standalone Guzzle instances. No Laravel-specific dependencies.ext-openssl)..env, vault)?HttpClient::withOptions() to inject the middleware into the default client:
$client = HttpClient::withOptions([
'handler' => HandlerStack::create()->push(new Oauth1([...])),
]);
HttpClient use cases (e.g., background jobs), instantiate Guzzle with the middleware as shown in the README.Authorization headers) with the middleware.config/oauth.php)..env or a secrets manager.GuzzleException) to detect credential issues early..env).$stack->push(Middleware::tap(function ($request) {
Log::debug('OAuth Request:', $request->getHeaders());
}));
oauth_problem errors.| Failure | Impact | Mitigation |
|---|---|---|
| Expired Token | 401 Unauthorized | Implement token refresh middleware. |
| Invalid Nonce | 401 Unauthorized (CVE-2025-21617) | Upgrade to v0.8.1+. |
| Missing/Invalid Secret | Signature Rejection | Validate config on boot. |
| API Rate Limits | Throttled Requests | Add retry-after headers handling. |
| Network Timeouts | Unsigned Requests | Use Guzzle’s retry middleware. |
config/oauth.php) and credential storage.telescope for OAuth-related request logging.guzzlehttp/oauth-subscriber to composer.json..env.How can I help you explore Laravel packages today?