Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed authentication v2 bug
  • Loading branch information
haphan committed Feb 9, 2018
commit 783a6cc7699b2c277b36403cd90504500a17c10f
13 changes: 7 additions & 6 deletions samples/identity/v2/authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use OpenStack\Common\Transport\Utils as TransportUtils;
use OpenStack\Identity\v2\Service;
use OpenStack\OpenStack;

$authUrl = 'https://keystone.example.com:5000/v2.0';

$httpClient = new Client([
'base_uri' => TransportUtils::normalizeUrl($authUrl),
'handler' => HandlerStack::create(),
]);

$options = [
'authUrl' => $authUrl,
'region' => 'RegionOne',
'username' => 'foo',
'password' => 'bar',
'tenantName' => 'baz',
'identityService' => new Client(
[
'base_uri' => TransportUtils::normalizeUrl($authUrl),
'handler' => HandlerStack::create(),
]
),
'identityService' => Service::factory($httpClient),
];

/** @var OpenStack $openstack */
Expand Down