openstack: Endpoint URL could not be found in the catalog for this service

Hello,

I have a problem with that authentification code:

require ‘vendor/autoload.php’;

$openstack = new OpenStack\OpenStack([
    'authUrl' => '{authUrl}',
    'region'  => '{region}',
    'user'    => [
        'id'       => '{userId}',
        'password' => '{password}'
    ],
    'scope'   => ['project' => ['id' => '{projectId}']]
]);

I change all these settings to my configuration.

Return to me that errror : When authenticating with a username, you must also provide either the domain name or domain ID to which the user belongs to. Alternatively, if you provide a user ID instead, you do not need to provide domain information.

So i changed to that one code adding domain information at the user array :

$openstack = new OpenStack\OpenStack([
    'authUrl' => '{authUrl}',
    'region'  => '{region}',
    'user'    => [
        'id'       => '{userId}',
        'domain'    => ['id' => 'default'],
        'password' => '{password}'
    ],
    'scope'   => ['project' => ['id' => '{projectId}']]
]);

But i got that error now : Endpoint URL could not be found in the catalog for this service. Name: swift Type: object-store Region: GRA1 URL type: public

The old API worked well with username password and tenantID. What can i do ? Thanks in advance.

About this issue

Most upvoted comments

Hi, after investigating, I solved the problem with the following code:


diff -ru vendor/php-opencloud/openstack/src/Identity/v3/Models/Endpoint.php ../openstack/vendor/php-opencloud/openstack/src/Identity/v3/Models/Endpoint.php
--- vendor/php-opencloud/openstack/src/Identity/v3/Models/Endpoint.php	2017-07-14 04:39:28.000000000 -0300
+++ ../openstack/vendor/php-opencloud/openstack/src/Identity/v3/Models/Endpoint.php	2017-09-18 16:37:45.303314819 -0300
@@ -77,6 +77,8 @@
 
     public function regionMatches(string $value): bool
     {
+        if($this->region == '*')
+            return true;
         return $this->region && $this->region == $value;
     }
 
diff -ru vendor/php-opencloud/openstack/src/Identity/v3/Models/Service.php ../openstack/vendor/php-opencloud/openstack/src/Identity/v3/Models/Service.php
--- vendor/php-opencloud/openstack/src/Identity/v3/Models/Service.php	2017-07-14 04:39:28.000000000 -0300
+++ ../openstack/vendor/php-opencloud/openstack/src/Identity/v3/Models/Service.php	2017-09-18 16:31:53.184373496 -0300
@@ -79,7 +79,7 @@
 
     private function typeMatches(string $value): bool
     {
-        return $this->type && $this->type = $value;
+        return $this->type && $this->type == $value;
     }
 
     /**
@@ -94,7 +94,7 @@
      */
     public function getUrl(string $name, string $type, string $region, string $interface)
     {
-        if (!$this->nameMatches($name) || !$this->typeMatches($type)) {
+        if (!$this->nameMatches($name) && !$this->typeMatches($type)) {
             return false;
         }