ngabor84 / guzzle-escher-middleware
Escher authentication middleware for Guzzle Http Client
0.4.0
2021-05-07 14:51 UTC
Requires
- php: ^7.3|^8.0
- emartech/escher: ^1.2
- guzzlehttp/guzzle: ^7.3
- psr/http-message: ^1.0
Requires (Dev)
- nunomaduro/larastan: ^0.7.5
- orchestra/testbench: ^v6.0
- phpstan/phpstan-phpunit: ^0.12.18
- phpunit/phpunit: ^9.3
README
Guzzle Escher Middleware
This authentication middleware add Escher sign functionality to Guzzle Http Client.
Installation
composer require ngabor84/guzzle-escher-middleware
Usage
<?php $credential = new \Guzzle\Http\Middleware\EscherCredential('key', 'secret', 'some/credential/scope'); $escherMiddleware = new \Guzzle\Http\Middleware\EscherMiddleware($credential); $stack = \GuzzleHttp\HandlerStack::create(); $stack->push($escherMiddleware); $client = new \GuzzleHttp\Client(['handler' => $stack]); // Important: set the auth option to escher to activate the middleware $response = $client->get('http://www.8points.de', ['auth' => 'escher']);