<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Hi Arif--</div>
<div> 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.</div>
<div> It looks like you have installed OpenStack with DevStack. If this is the case:</div>
<div><br>
</div>
<div> $ cd ~/devstack</div>
<div> $ source openrc admin admin</div>
<div> $ openstack secret store –p "super secret data"</div>
<div> # An HREF is returned in the response when the secret has been stored</div>
<div> $ openstack secret get <HREF> -p </div>
<div> # Your secret is returned</div>
<div><br>
</div>
<div> 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.</div>
<div>--Dave</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>OpenStack Mailing List Archive <<a href="mailto:corpqa@gmail.com">corpqa@gmail.com</a>><br>
<span style="font-weight:bold">Reply-To: </span>"OpenStack Development Mailing List (not for usage questions)" <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Date: </span>Monday, October 26, 2015 at 1:46 AM<br>
<span style="font-weight:bold">To: </span>"OpenStack Development Mailing List (not for usage questions)" <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [openstack-dev] openstack-barbican-authenticate-keystone-barbican-command<br>
</div>
<div><br>
</div>
<div>
<div>Link: <a href="https://openstack.nimeyo.com/62868/?show=63238#c63238">https://openstack.nimeyo.com/62868/?show=63238#c63238</a><br>
From: marif82 <<a href="mailto:marif82@gmail.com">marif82@gmail.com</a>><br>
<br>
<p>Hi Dave,</p>
<p>Thanks for your response.<br>
I am the beginner in OpenStack so I don't know how to get Keystone token so I searched and found "admin<em>token = a682f596-76f3-11e3-b3b2-e716f9080d50" in keystone.conf file. As you suggested i have removed the project</em>id 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:</p>
<p>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", "payload<em>content</em>type": "text/plain"}'
<a rel="nofollow" href="http://localhost:9311/v1/secrets">http://localhost:9311/v1/secrets</a> -v<br>
* About to connect() to localhost port 9311 (<a rel="nofollow" href="https://openstack.nimeyo.com/tag/0">#0</a>)<br>
* Trying ::1...<br>
* Connection refused<br>
* Trying 127.0.0.1...<br>
* Connected to localhost (127.0.0.1) port 9311 (<a rel="nofollow" href="https://openstack.nimeyo.com/tag/0">#0</a>)</p>
<blockquote>
<div>
<p>POST /v1/secrets HTTP/1.1<br>
User-Agent: curl/7.29.0<br>
Host: localhost:9311<br>
Accept: <em>/</em><br>
content-type:application/json<br>
X-Auth-Token:a682f59676f311e3b3b2e716f9080d50<br>
X-Project-Id:12345<br>
Content-Length: 67</p>
</div>
</blockquote>
<p>* upload completely sent off: 67 out of 67 bytes<br>
< HTTP/1.1 401 Unauthorized<br>
< Content-Type: text/html; charset=UTF-8<br>
< Content-Length: 23<br>
< WWW-Authenticate: Keystone uri='<a rel="nofollow" href="http://localhost:35357">http://localhost:35357</a>'<br>
< Connection: close<br>
<<br>
* Closing connection 0<br>
Authentication requiredbash-4.2$</p>
<p>Please help me.</p>
<p>Regards,<br>
Arif</p>
</div>
</div>
</span>
</body>
</html>