library lib-hawk-authentication-guzzle-subscriber
Guzzle subscriber for Hawk Authentication
vytautasgimbutas/lib-hawk-authentication-guzzle-subscriber
Guzzle subscriber for Hawk Authentication
- Sunday, March 15, 2015
- by vytautasgimbutas
- Repository
- 1 Watchers
- 0 Stars
- 8 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 3 Versions
- 33 % Grown
Guzzle Subscriber for Hawk Authentication
Hawk specification can be found here: http://alexbilbie.com/2012/11/hawk-a-new-http-authentication-scheme/, (*1)
[Using Symfony2? Check out Hawk Authentication bundle that uses Symfony2 Security component.][1], (*2)
Usage
use Tornado\Component\HawkAuthentication\HawkAuthenticationSubscriber;
use Dflydev\Hawk\Client\ClientBuilder;
use Dflydev\Hawk\Credentials\Credentials;
use GuzzleHttp\Client;
$id = '12345';
$secret = 'asd';
$client = ClientBuilder::create()->build();
$credentials = new Credentials($secret, 'sha256', $id);
$hawkAuthenticationPlugin = new HawkAuthenticationSubscriber(
$client,
$credentials
);
$httpClient = new Client();
/** @var \GuzzleHttp\Message\Response $response */
$response = $httpClient->post('https://test.dev/app_dev.php/rest?a=b', [
'json' => array('a' => 'b'),
'subscribers' => array($hawkAuthenticationPlugin),
]);
v1.0.1
1.0.1.0
Guzzle subscriber for Hawk Authentication
Sources
Download
MIT
The Requires
by
Vytautas Gimbutas
authentication
subscriber
guzzle
hawk
dev-master
9999999-dev
Guzzle subscriber for Hawk Authentication
Sources
Download
MIT
The Requires
by
Vytautas Gimbutas
v1.0.0
1.0.0.0
Guzzle subscriber for Hawk Authentication
Sources
Download
MIT
The Requires
by
Vytautas Gimbutas