Ask Your Question
0

Swift-keystone integration: Getting HTTP/1.1 401 Unauthorized error [closed]

asked 2014-07-26 06:15:16 -0500

traz gravatar image

updated 2014-08-19 12:45:57 -0500

briancline gravatar image

Token is generated by keystone:

curl -v -d '{"auth": {"passwordCredentials": {"username": "user1", "password": "user1"}, "tenantName": "swift_tenant1"}}' -H "Content-type: application/json" http://10.0.4.52:5000/v2.0/tokens
* About to connect() to 10.0.4.52 port 5000
*   Trying 10.0.4.52... connected
* Connected to 10.0.4.52 (10.0.4.52) port 5000
> POST /v2.0/tokens HTTP/1.1
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: 10.0.4.52:5000
> Accept: */*
> Content-type: application/json
> Content-Length: 108
> 
> {"auth": {"passwordCredentials": {"username": "user1", "password": "user1"}, "tenantName": "swift_tenant1"}}HTTP/1.1 200 OK
< Vary: X-Auth-Token
< Content-Type: application/json
< Content-Length: 730
< Date: Sat, 26 Jul 2014 07:43:49 GMT
Connection #0 to host 10.0.4.52 left intact
* Closing connection #0
{"access": {"token": {"issued_at": "2014-07-26T07:43:49.687066", "expires": "2014-07-26T08:43:49Z", "id": "a2ed3602135e4ad587ad7cc0576afb71", "tenant": {"description": null, "enabled": true, "id": "6f80c94891694739b75e4897b065c010", "name": "swift_tenant1"}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://10.0.0.80:8080/v2.0", "region": "regionOne", "publicURL": "http://10.0.0.80:8080/v2.0", "id": "58a17ca4ec5b40c18f4f47121828b363"}], "endpoints_links": [], "type": "object_storage", "name": "swift"}], "user": {"username": "user1", "roles_links": [], "id": "b0cc603bc4e3450d8d63efa2f7bfca0e", "roles": [{"name": "admin"}], "name": "user1"}, "metadata": {"is_admin": 0, "roles": ["8d5a6baa02b144ae850722711dff3483"]}}}

But still getting authorization error

curl -v -H "X-Auth-Token: a2ed3602135e4ad587ad7cc0576afb71" http://10.0.0.80:8080/v1.0/6f80c94891694739b75e4897b065c010* About to connect() to 10.0.0.80 port 8080
*   Trying 10.0.0.80... connected
* Connected to 10.0.0.80 (10.0.0.80) port 8080
> GET /v1.0/6f80c94891694739b75e4897b065c010 HTTP/1.1
> User-Agent: curl/7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: 10.0.0.80:8080
> Accept: */*
> X-Auth-Token: a2ed3602135e4ad587ad7cc0576afb71
> 
< **HTTP/1.1 401 Unauthorized**
< Content-Length: 131
< Content-Type: text/html; charset=UTF-8
< Www-Authenticate: Swift realm="6f80c94891694739b75e4897b065c010"
< X-Trans-Id: txcfaef72f2db6491fbf9ec-0053d3aa47
< Date: Sat, 26 Jul 2014 13:16:55 GMT
Connection #0 to host 10.0.0.80 left intact
* Closing connection #0
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by SamYaple
close date 2014-08-19 13:45:57.431300

Comments

Can u paste what the configuration u have done in proxy-server ,and are u trying to set swift as back-end storage to the glance paste the glance configuration alsp

PremKumarSubramaniyan gravatar imagePremKumarSubramaniyan ( 2014-07-27 04:05:27 -0500 )edit

[DEFAULT] bind_port = 8080 workers = 1 user = root log_facility = LOG_LOCAL1 eventlet_debug = true

[pipeline:main] pipeline = catch_errors healthcheck cache authtoken keystone proxy-server

[filter:cache] use = egg:swift#memcache memcache_servers = 10.0.0.80:11211

[app:proxy-server] use = egg:swift#proxy allow_account_management = true account_autocreate = true

[filter:keystone] paste.filter_factory = keystoneclient.middleware.keystone_auth:filter_factory operator_roles = admin, swiftoperator

[filter:authtoken] paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory delay_auth_decision = true service_port = 5000 service_host = 10.0.4.52 auth_port = 35357 auth_host = 10.0.4.52 auth_token = ADMIN admin_token = ADMIN cache = swift.cache auth_protocol = http

I'm trying to integrate swift and keystone. I'm able to get the token, but on using that token I'm getting authorization error.

traz gravatar imagetraz ( 2014-07-27 12:10:53 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-07-27 22:59:16 -0500

traz gravatar image

The problem is solved now with help of jamielennox on http://webchat.freenode.net/

The pipeline in proxy-server.conf required correction

pipeline = catch_errors healthcheck cache authtoken proxy-server

http://paste.openstack.org/show/88612/

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2014-07-26 06:15:16 -0500

Seen: 1,593 times

Last updated: Jul 31 '14