Created: 2014-05-19 11:28
Updated: 2016-04-01 13:42
License: mit

Keystone Client

Latest Version on Packagist Software License Build Status Coverage Status Quality Score

A client to use when communicating with Keystone services. Uses Guzzle as the actual HTTP client library.


composer require treehouselabs/keystone-client:~3.0


Use the ClientFactory to create a Guzzle Client with. The factory attaches middleware that automatically requests a Keystone token and signs outgoing requests with it.

In the case of an expired token, and the request fails, a new token is fetched automatically and the request is retried with the new token.

use TreeHouse\Cache\CacheInterface;
use TreeHouse\Keystone\Client\ClientFactory;
use TreeHouse\Keystone\Client\Model\Tenant;

$tokenUrl     = '';
$username     = 'acme';
$password     = 's3cr4t';
$serviceType  = 'compute';
$serviceName  = 'api';

// $cache is a TreeHouse\Cache\CacheInterface instance
$tenant  = new Tenant($tokenUrl, $username, $password, $serviceType, $serviceName);
$client  = (new ClientFactory($cache))->createClient($tenant);

// now just use $client as you would a regular Guzzle client
$response = $client->get('posts/');


composer test


If you discover any security related issues, please email instead of using the issue tracker.


The MIT License (MIT). Please see License File for more information.


Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more