problem with authorization in swift and keystone

asked 2020-02-03 05:13:19 -0600

Hamid gravatar image

updated 2020-02-03 05:56:31 -0600


I hve installed swift in my servers this is my scenario:

server1: Keystone+Memcached+Swift Proxy

Server2: Memcached+Swift Proxy

Server3:Swift node storage

Server4:Swift node storage

after installing i tryied to test it but when i wanted to use curl for issuing the auth key , it writes:Unauthorized

I'm using openstack Queen and ubuntu 16.04 LTS

this is my command and resault:

"" $ curl -i -H "Content-Type: application/json" -d '

{ "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "domain": { "id": "Default" }, "name": "admin", "password": "123456" } } }, "scope": { "project": { "domain": { "id": "default" }, "name": "service" } } } }' "http://localhost:5000/v3/auth/tokens" ; echo


HTTP/1.1 401 Unauthorized Date: Mon, 03 Feb 2020 10:57:20 GMT Server: Apache/2.4.18 (Ubuntu) Vary: X-Auth-Token X-Distribution: Ubuntu x-openstack-request-id: req-899c6fc9-5b5b-440c-a9c4-bc8d603b49eb WWW-Authenticate: Keystone uri="http://localhost:5000" Content-Length: 114 Content-Type: application/json

{"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}} "" and this is log file resault:


sudo tail -f /var/log/keystone/keystone-wsgi-public.log


"" 2020-02-03 14:31:10.177 5457 INFO keystone.common.wsgi [req-0db49a5f-b2ed-48f0-9da0-35e6966014b0 - - - - -] POST http://controller-1:5000/v3/auth/tokens 2020-02-03 14:31:10.283 5457 WARNING keystone.auth.plugins.core [req-0db49a5f-b2ed-48f0-9da0-35e6966014b0 - - - - -] Could not find domain: Default.: DomainNotFound: Could not find domain: Default. 2020-02-03 14:31:10.284 5457 WARNING keystone.common.wsgi [req-0db49a5f-b2ed-48f0-9da0-35e6966014b0 - - - - -] Authorization failed. The request you have made requires authentication. from Unauthorized: The request you have made requires authentication. ""

Please help me to solve my problem.

Best Regards.

edit retag flag offensive close merge delete


And even when i type command below after running admin-openrc shell it says:

$ openstack container create container1

Not Found (HTTP 404) (Request-ID: txb6dd0f9b424741bb84318-005e380bc5)

Hamid gravatar imageHamid ( 2020-02-03 06:08:01 -0600 )edit

The domain ID in the password structure is Default, but in the scope structure it's default. One of the two is incorrect; based on the log message, I guess Default is the culprit.

Bernd Bausch gravatar imageBernd Bausch ( 2020-02-03 06:09:00 -0600 )edit

I don't know what 404 means when creating the container, but the Swift log should provide some clarity. Use the request ID to find relevant messages.

Bernd Bausch gravatar imageBernd Bausch ( 2020-02-03 06:28:09 -0600 )edit

How can i see this?

Hamid gravatar imageHamid ( 2020-02-03 07:01:38 -0600 )edit

I edit my curl command and both are Default but when i ran the command it shows the same error:

{"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}} and ahead of "X-Auth-Token" is blank....

Hamid gravatar imageHamid ( 2020-02-03 07:04:49 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2020-02-10 06:29:57 -0600

updated 2020-02-10 07:07:29 -0600

This is the answer:

1- First problem: You are trying to authenticate with user admin, project service. This doesn't work because (probably) admin has no role in service. Run openstack role assignment list --user admin --names to confirm this.

2- Your second problem is not a problem. The second command in successfully authenticates you and returns the token in a header, line 31:

HTTP/1.1 201 Created
Date: Mon, 10 Feb 2020 08:40:47 GMT
Server: Apache/2.4.18 (Ubuntu)
X-Subject-Token: gAAAAABeQRcPH5dJIGd64eCdXvOZkBrXKQ6kQPQnLCIBDI9JnZ-dGkLoBGWf16DRtWwrr5frVDn5cy8U3y41lrMMmaqjXXEDf3eHaj19R25s2L7ON49n6OC5UrArUTfTquiz75domDPCNw--PxZLdTuOfk4VSbNn3dLdK-8kYEKJUa88F37kwhk
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2020-02-03 05:09:32 -0600

Seen: 385 times

Last updated: Feb 10 '20