Skip to content

401 UNAUTHORIZED #413

Open
Open
@AlyabyevSergey

Description

@AlyabyevSergey

I've been struggling all day, I can't figure out why it doesn't work:

` $authUrl = 'https://cs.advanced.host/v3/';
$region = 'EU';
$username = 'XXXXXX';
$password = 'XXXXXXXX';
$project = 'XXXXX';

    $openstack = new OpenStack([
        'authUrl' => $authUrl,
        'region'  => $region,
        'user'             => [
            'name'     => $username,
            'password' => $password,
            'domain'   => ['name' => 'default', 'id' => 'default'],
        ],

        'scope'   => ['project' => ['id' => $project]],

    ]);

    $service = $openstack->objectStoreV1();`

return:

The remote server returned a "401 UNAUTHORIZED" error for the following transaction:

Request

POST /v3/auth/tokens HTTP/1.1
User-Agent: GuzzleHttp/7
Content-Type: application/json
Host: cs.advanced.host

Response

HTTP/1.1 401 UNAUTHORIZED
Server: nginx/1.24.0
Date: Mon, 01 Jul 2024 09:41:49 GMT
Content-Type: application/json
Content-Length: 109
Connection: keep-alive
WWW-Authenticate: Keystone uri="https://cs.advanced.host/v3"
Vary: X-Auth-Token
x-openstack-request-id: req-64cbc751-0cf0-4351-a48e-18d625303995
Access-Control-Allow-Methods: HEAD,GET,POST,PUT,PATCH,DELETE,OPTIONS
Access-Control-Allow-Headers: Content-Type,X-Requested-With,X-Auth-Token,X-Openstack-Request-Id,X-Subject-Token

{"error":{"code":401,"message":"The request you have made requires authentication.","title":"Unauthorized"}}

what to do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions