-
Notifications
You must be signed in to change notification settings - Fork 11
how to use authentication token from the header from login #30
Comments
If you're still using phosphor-rest-server, you don't need to do any token authentication at all. The openbmc master recently moved to using bmcweb as the REST server, and that is where you'll need it. I attempted to explain that here: https://github.com/openbmc/docs/blob/master/REST-cheatsheet.md#notes-on-authentication, but by all means I won't be offended if you would like to submit a patch to reword it. |
Sorry but I am a little confused with this BMC. This is on an IBM Witherspoon system. The version has a 2.6-prod in it .. not sure if that means its a 2.6 based?? But many of the authentication mechanisms dont seem to be working for me.. unless I am using them the wrong way. But following the documentation.. here is what I see. -- What works -- $ curl -b cjar -k https://${bmc}/xz/openbmc_project/list -- what does not work --
Could you please tell me what I might be doing wrong? |
The only one that is valid for you, with a witherspoon with phosphor-rest, is the example you gave that works. |
As per the docs https://github.com/openbmc/docs/blob/master/REST-cheatsheet.md
curl returns the SID with the command below. But using the sid in followup commands does not work. May be the documentation is out of date? or what am I doing wrong here ?
$ curl -i -k -H "Content-Type: application/json" -X POST https://${bmc}/login -d "{"data": [ "root", "0penBmc" ] }"
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 13 Feb 2019 07:44:11 GMT
Content-Type: application/json
Content-Length: 80
Connection: keep-alive
Keep-Alive: timeout=5
Set-Cookie: sid="!jO06vHb3/3tbu1H4A+hYXA==?gAJVA3NpZHEBVSAf3Q/UklNfDh4X1j8HOjeZQfuIhSsptVmjnWtHDquoIHEChnEDLg=="; httponly; secure
{
"data": "User 'root' logged in",
"message": "200 OK",
"status": "ok"
}
$ tok='!jO06vHb3/3tbu1H4A+hYXA==?gAJVA3NpZHEBVSAf3Q/UklNfDh4X1j8HOjeZQfuIhSsptVmjnWtHDquoIHEChnEDLg=='
$ echo $tok
!jO06vHb3/3tbu1H4A+hYXA==?gAJVA3NpZHEBVSAf3Q/UklNfDh4X1j8HOjeZQfuIhSsptVmjnWtHDquoIHEChnEDLg==
$ curl -H "X-Auth-Token: {bmc}/xyz/openbmc_project/enumerate
curl: (60) SSL certificate problem: self signed certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
The text was updated successfully, but these errors were encountered: