failure in generating token using js or python

asked 2018-10-02 08:32:39 -0600

ehab gravatar image

Hello, I'm beginner who just started learning openstack I'm having trouble with tokens it would work perfectly fine, if i try to access dashboard using username and password or generating token using curl like in guide https://docs.openstack.org/keystone/pike/api_curl_examples.html (https://docs.openstack.org/keystone/p...)

however, if i try to send POST request using js, python or even postman, then i don't receive any response

here is my js code:

function myFunction() {
            var xhr = new XMLHttpRequest();
            var content_type = "Content-Type: application/json"
            var url = "http://localhost:5000/v3/auth/tokens" ;
            var request_body = '{ "auth": {'+
                                    '"identity": {'+
                                      '"methods": ["password"],'+
                                      '"password": {'+
                                        '"user": {'+
                                          'name": "admin",'+
                                          '"domain": { "id": "default" },'+
                                          '"password": "openstack"'+
                                        '}'+
                                      '}'+
                                    '},'+
                                    '"scope": {'+
                                      '"project": {'+
                                        '"name": "demo",'+
                                        '"domain": { "id": "default" }'+
                                      '}'+
                                    '}'+
                                  '}'+
                                '}' ;
            xhr.open("POST", url, true);
            xhr.send(request_body);
        }

i receive null response

and in postman i get

Could not get any response There was an error connecting to http://localhost:5000/v3/auth/tokens

similar situation when i try python

what is the wrong thing i'm doing exactly ?

edit retag flag offensive close merge delete