Hi Arif--
    Maybe using the OpenStack client would be easier for you.  It will take 
care of authenticating with Keystone, setting the HTTP headers, and providing 
reasonable defaults.
    It looks like you have installed OpenStack with DevStack.  If this is the 
case:

    $ cd ~/devstack
    $ source openrc admin admin
    $ openstack secret store -p "super secret data"
    # An HREF is returned in the response when the secret has been stored
    $ openstack secret get  <HREF> -p
    # Your secret is returned

   Drop by our IRC channel at #openstack-barbican on freenode if you have more 
questions, or if this suggestion doesn't work with your deployment.
--Dave

From: OpenStack Mailing List Archive <cor...@gmail.com<mailto:cor...@gmail.com>>
Reply-To: "OpenStack Development Mailing List (not for usage questions)" 
<openstack-dev@lists.openstack.org<mailto:openstack-dev@lists.openstack.org>>
Date: Monday, October 26, 2015 at 1:46 AM
To: "OpenStack Development Mailing List (not for usage questions)" 
<openstack-dev@lists.openstack.org<mailto:openstack-dev@lists.openstack.org>>
Subject: Re: [openstack-dev] 
openstack-barbican-authenticate-keystone-barbican-command

Link: https://openstack.nimeyo.com/62868/?show=63238#c63238
From: marif82 <mari...@gmail.com<mailto:mari...@gmail.com>>


Hi Dave,

Thanks for your response.
I am the beginner in OpenStack so I don't know how to get Keystone token so I 
searched and found "admintoken = a682f596-76f3-11e3-b3b2-e716f9080d50" in 
keystone.conf file. As you suggested i have removed the projectid from curl 
command and X-Auth-Token in curl command as per your suggestion and I am still 
getting the same error, please see below:

bash-4.2$ curl -X POST -H 'content-type:application/json' -H 
'X-Auth-Token:a682f59676f311e3b3b2e716f9080d50' -H 'X-Project-Id:12345' -d 
'{"payload": "my-secret-here", "payloadcontenttype": "text/plain"}' 
http://localhost:9311/v1/secrets -v
* About to connect() to localhost port 9311 
(#0<https://openstack.nimeyo.com/tag/0>)
* Trying ::1...
* Connection refused
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9311 
(#0<https://openstack.nimeyo.com/tag/0>)

POST /v1/secrets HTTP/1.1
User-Agent: curl/7.29.0
Host: localhost:9311
Accept: /
content-type:application/json
X-Auth-Token:a682f59676f311e3b3b2e716f9080d50
X-Project-Id:12345
Content-Length: 67

* upload completely sent off: 67 out of 67 bytes
< HTTP/1.1 401 Unauthorized
< Content-Type: text/html; charset=UTF-8
< Content-Length: 23
< WWW-Authenticate: Keystone uri='http://localhost:35357'
< Connection: close
<
* Closing connection 0
Authentication requiredbash-4.2$

Please help me.

Regards,
Arif
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to