DEPRECATED in favor of https://github.com/php-http/authentication
Easily authenticate requests in Ivory Http Adapter.
Via Composer
$ composer require indigophp/http-adapter-auth
- Create your custom authentication implementing
Indigo\HttpAdapter\Authentication
interface (BasicAuth is provided by the package) - Wrap your HTTP Adapter of choice into an
Indigo\HttpAdapter\AuthenticatingHttpAdapter
- Enjoy!
use Indigo\HttpAdapter\AuthenticatingHttpAdapter;
use Indigo\HttpAdapter\Authentication\BasicAuth;
use Ivory\HttpAdapter\HttpAdapterFactory;
$httpAdapter = HttpAdapterFactory::guess();
$authentication = new BasicAuth('john.doe', 'secret');
$httpAdapter = new AuthenticatingHttpAdapter($httpAdapter, $authentication);
$ phpspec run
PHP 7 will introduce scalar type hints, thus for the long run it makes no sense to write checks for scalar types. Until PHP 7 is not released (and became the most commonly used version) beberlei/assert is used for type checking. Any further checks should be done in the code.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.