Can't access Quantum services via REST requests

Asked by Jasmeet Bhatia

I can't seem to access the quantum services via the REST requests. The quantum CLI client works just fine. Also the non-quantum REST services work fine with the authentication credentials..

curl -d '{"auth":{"passwordCredentials":{"username": "admin", "password": "os"}}}' -H "Content-type: application/json"

  <title>401 Unauthorized</title>
  <h1>401 Unauthorized</h1>
  This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.<br /><br />
Authentication required

Question information

English Edit question
neutron Edit question
No assignee Edit question
Solved by:
Akihiro Motoki
Last query:
Last reply:
Revision history for this message
Akihiro Motoki (amotoki) said :

If your quantum server is configured to use keystone auth (it is default in Folsom), you need to fetch a valid token from keystone before accesing quantum server.

Command lines are here when I tested:

I hope it will help you.

Revision history for this message
Vikas Deolaliker (vikasd) said :


When you fetch the token in your example, where did you use them in your rest calls?

Revision history for this message
Best Akihiro Motoki (amotoki) said :

"id" returned by token-get should be passed as X-Auth-Token in REST call.

In my last command line, "X-Auth-Token: dcf3d36161154f9faedcec7d16cc01ff" should be "X-Auth-Token: f21fb6ffde104696ad5a3c854391ce75".

I did a mistake when I prepared the command lines to paste them. I reused the previous command line without updating the token. The previous token "dcf3d36161154f9faedcec7d16cc01ff" is also valid in this case.

Revision history for this message
Jasmeet Bhatia (jasmbhat) said :

Thanks Akihiro Motoki, that solved my question.