library guzzle-escher-middleware
Escher authentication middleware for Guzzle Http Client
ngabor84/guzzle-escher-middleware
Escher authentication middleware for Guzzle Http Client
- Friday, April 20, 2018
- by ngabor84
- Repository
- 0 Watchers
- 0 Stars
- 9 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 125 % Grown
, (*1)
Guzzle Escher Middleware
This authentication middleware add Escher sign functionality to Guzzle Http Client., (*2)
Installation
composer require ngabor84/guzzle-escher-middleware
, (*3)
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']);