fog-openstack
fog-openstack copied to clipboard
Keystone v3 doesn't work in fog-openstack version 0.1.20
When I check it using curl command like below, I can get keystone response with 201. curl -H "Content-Type: application/json" -X POST -d '{ "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "admin", "domain": { "name": "Default" }, "password": "cEA4fcGlD77AOtVPyodciSukxgBxH9juOpTKz6FZ" } } } } } ' http://10.113.65.80:5000/v3/auth/tokens
With same test, it does not work via fog-openstack 0.1.20.
[----] E, [2017-06-02T16:48:53.155193 #4139:2ad73e5dedc4] ERROR -- : excon.error #<Excon::Error::Unauthorized: Expected([201]) <=> Actual(401 Unauthorized) excon.error.response :body => "{"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}" :cookies => [ ] :headers => { "Cache-Control" => "proxy-revalidate" "Connection" => "close" "Content-Length" => "114" "Content-Type" => "application/json" "Date" => "Fri, 02 Jun 2017 07:48:53 GMT" "Proxy-support" => "Session-based-authentication" "Server" => "Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5" "Vary" => "X-Auth-Token" "WWW-Authenticate" => "Keystone uri="http://10.113.65.80:5000"" "x-openstack-request-id" => "req-286c89b8-e293-42a7-9c40-03216752474c" } :host => "10.113.65.80" :local_address => "10.113.65.146" :local_port => 40586 :path => "/v3/auth/tokens" :port => 5000 :reason_phrase => "Unauthorized" :remote_ip => "10.112.1.184" :status => 401 :status_line => "HTTP/1.1 401 Unauthorized\r\n"
===================================================================
Anybody can help me to solve this problem?
Hi, can you check/post your fog connection params, please? It should look something like this:
{
openstack_auth_url: "http://10.113.65.80:5000/v3/auth/tokens",
openstack_username: "admin",
openstack_api_key: "cEA4fcGlD77AOtVPyodciSukxgBxH9juOpTKz6FZ",
openstack_domain_name: "Default"
}
@Carthaca This is the params you mentioned. { openstack_auth_url => http://10.113.65.80:5000/v3/auth/tokens openstack_username => admin openstack_api_key => cEA4fcGlD77AOtVPyodciSukxgBxH9juOpTKz6FZ openstack_endpoint_type => publicURL openstack_domain_id => default openstack_region => RegionOne }
This is request and response raw data. POST http://10.113.65.80:5000/v3/auth/tokens HTTP/1.1 User-Agent: fog-core/1.44.1 Proxy-Connection: Keep-Alive Content-Type: application/json Host: 10.113.65.80:5000 Content-Length: 199 {"auth":{"identity":{"methods":["password"],"password":{"user":{"password":"cEA4fcGlD77AOtVPyodciSukxgBxH9juOpTKz6FZ","domain":{"id":"default"},"name":"admin"}}},"scope":{"domain":{"id":"default"}}}}
HTTP/1.1 401 Unauthorized Date: Tue, 06 Jun 2017 08:35:59 GMT Server: Apache/2.4.6 (CentOS) mod_wsgi/3.4 Python/2.7.5 Vary: X-Auth-Token x-openstack-request-id: req-0b90c245-6a37-4fd6-9a65-64e2ac5d31be WWW-Authenticate: Keystone uri="http://10.113.65.80:5000" Content-Length: 114 Content-Type: application/json Cache-Control: proxy-revalidate Connection: close Proxy-support: Session-based-authentication
Ah sorry, you want an unscoped token, so it should look like this:
{
openstack_auth_url: "http://10.113.65.80:5000/v3/auth/tokens",
openstack_username: "admin",
openstack_api_key: "cEA4fcGlD77AOtVPyodciSukxgBxH9juOpTKz6FZ",
openstack_user_domain: "Default"
}