2017 © Pedro Peláez
 

library guzzle-hawk

A GuzzlePHP plugin for Hawk authentication

image

complex-media/guzzle-hawk

A GuzzlePHP plugin for Hawk authentication

  • Thursday, October 15, 2015
  • by complex
  • Repository
  • 4 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

A Hawk Authenticator for Guzzle.

Originally developed by jeskew, this extremely simple Plugin provides middleware you can place on your Guzzle client to automagically sign your requests., (*1)

Usage

First, install with Composer:, (*2)

composer require complex-media/guzzle-hawk

Then, use it in code., (*3)

use ComplexMedia\Guzzle\Plugin\Hawk;
use GuzzleHttp\Client as Guzzle;

$client = new Guzzle();
$signer = new Hawk($key, $secret, $algorithm, $offset);

$client->getEmitter()->attach($signer);
$response = $client->get($URL);

$algorithm will default to 'sha256', but you can set it to whatever your system supports. $offset adds a clock skew to synchronize with your server, and defaults to 0. If you get a 401 from your server, you can adjust several properties on the signer and try again immediately:, (*4)

$signer->key = $new_key
$signer->secret = $new_secret
$signer->algorithm = $new_algorithm
$signer->offset = $new_offset

$response = $client->get($URL);

Contributing

Yes, (*5)

License

MIT License applies., (*6)

The Versions

15/10 2015

dev-master

9999999-dev

A GuzzlePHP plugin for Hawk authentication

  Sources   Download

MIT

The Requires

 

by Complex Media

14/10 2015

v0.1.0

0.1.0.0

A GuzzlePHP plugin for Hawk authentication

  Sources   Download

MIT

The Requires

 

by Complex Media

27/06 2014

dev-feature/parse-payload

dev-feature/parse-payload

A GuzzlePHP plugin for Hawk authentication

  Sources   Download

MIT

The Requires

 

by Jonathan Eskew