Open benIT opened 6 years ago
It seems that the documentation is not up to date.
The example in the documentation are still making use of:
id
under the user
sectiondomain
is missing under the user
section$openstack = new OpenStack\OpenStack([
'authUrl' => '{authUrl}',
'region' => '{region}',
'user' => [
'id' => '{userId}',
'password' => '{password}'
],
'scope' => [
'project' => [
'id' => '{projectId}'
]
]
]);
which causes 401
error.
According to the response given in issue #248 , the following snippet works:
$requestOptions = [
'verify' => 'certificate.crt',
];
$openstack = new OpenStack\OpenStack([
'authUrl' => $env['auth_url'],
'region' => $env['region_name'],
'user' => [
'name' => $env['username'],
'password' => $env['password'],
'domain' => ['name' => $env['domain_name']]
],
'scope' => [
'project' => ['id' => $env['project_id']],
],
'requestOptions' => $requestOptions
]);
$service = $openstack->objectStoreV1();
foreach ($service->listContainers() as $container) {
/** @var $container \OpenStack\ObjectStore\v1\Models\Container */
var_dump($container);
}
Greetings, Ben
I am trying to run the following script(adapted from this example):
But I get a 401 response:
Env vars have been checked multiple times, and the openstack python CLI is working fine with these env variables.
I also tried other examples from the doc, but I am getting the same 401 response.
Any idea what's wrong with that?