ngabor84/guzzle-escher-middleware

Escher authentication middleware for Guzzle Http Client

0.4.0 2021-05-07 14:51 UTC

This package is auto-updated.

Last update: 2024-04-07 20:49:03 UTC


README

Codeship Status for ngabor84/guzzle-escher-middleware GitHub license

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']);