eightpoints / guzzle-wsse-middleware
WSSE Middleware for Guzzle, a PHP HTTP client library and framework for building RESTful web service clients
Installs: 2 035 574
Dependents: 5
Suggesters: 0
Security: 0
Stars: 31
Watchers: 3
Forks: 3
Open Issues: 0
Requires
- php: >=5.5
- guzzlehttp/guzzle: >=6.0
- paragonie/random_compat: >=2
README
This middleware integrates WSSE funtionality into Guzzle, a PHP framework for building RESTful web service clients.
Requirements
- PHP 5.5 or above
- Guzzle PHP Framework
Installation
Using composer:
{ "require": { "eightpoints/guzzle-wsse-middleware": "^4.1.1" } }
Usage
<?php $wsse = new \EightPoints\Guzzle\WsseAuthMiddleware($username, $password); # Optional: Set createdAt by a expression (if not, current time will be used automatically) # http://php.net/manual/en/datetime.formats.relative.php # Useful if there is a small difference of time between client and server # DateTime object will be regenerated for every request $wsse->setCreatedAtTimeExpression('-10 seconds'); $stack = \GuzzleHttp\HandlerStack::create(); // Add the wsse middleware to the handler stack. $stack->push($wsse->attach()); $client = new \GuzzleHttp\Client(['handler' => $stack]); $response = $client->get('http://www.8points.de');
Authors
- Florian Preusner (Twitter)
See also the list of contributors who participated in this project.
License
This middleware is licensed under the MIT License - see the LICENSE file for details