Authentication Error using API on Grizzly
Hi guys, I'm trying to access to Nova using a REST client but everytime I got an "Authentication Required" response. My goal will be to access, foreach vServer, to its diagnostics info, but now I'm stucked far away from that. I'm using DevStack but I also tried with an another OpenStack manually installed.
My REST requests are (in order):
Method: POST, Url: http://172.16.0.1:5000/v2.0/tokens, Body: admin:password or demo:password
And i got a valid token.
Method: GET, Url: http://172.16.0.1:5000/v2.0/tenants, Header: X-Auth-Token:{token got previously}
And I got a list of tenants for that token; if I have understood right these tenants are the ones that I can handle with my token. Probably the are others but Keystone lists and gives me access only for the ones of which I have authority.
Method: GET, Url: http://172.16.0.1:8774/v2/{one_of_the_tenant_id_got_previously}/servers, Header: X-Auth-Token:{token got previously}
I'll expect to be able to get the lists of the servers but I'm not... When I try I got a response with this headers:
Status Code: 401 Unauthorized
Connection: keep-alive
Content-Length: 23
Content-Type: text/plain
Date: Mon, 16 Sep 2013 16:15:36 GMT
WWW-Authenticate: Keystone uri='http://172.16.0.1:35357'
And this body: Authentication required
I also tried to make the rest call with the command "cURL" instead of using the client but it's the same. Can someone please help me to figure it out?
Thanks
Hi, did you check if the token is valid by trying any other request?
Well, in the first GET call the token is valid bacause I can get the list of the tenants (but I'm still asking to Keystone). I got the same error with others requests (a tried to use the Ceilometer API or Object Storage API)... Should I put anything into the request (header or body)?
I figured it out that I need to specify the tenantName when I want to obtain the token. But the API documentation says that the tenantName is OPTIONAL... it isn't in my case! Has anyone ever tried to obtain a token without specifying this parameter? Is it a bug or have I misunderstood something?
You should be able to authorize without a tenant so that you can get your tenants. You might have to authorize again with the tenant you want to use.