REST API Authentication

How to authenticate to use the REST API.

Request URLs
/ibmsa/v2/login
/ibmsa/v2/logout
Method
POST
Request data
There are currently 2 ways of authenticating to the REST API, using an existing Linux User from the REST API's Host Node or providing a private SSH Key stored in the REST API's Host Node and its passphrase.
If using CURL, use the parameter -c when logging in to indicate in which file will the cookies be stored, after logging in, every subsequent request should include the cookies file using the -b parameter.
Note: Any user account can log in and perform GET requests. However, only user accounts with the “Administrator” role can issue POST/PUT requests.
username: <string>
User of an existing Linux User
password: <string>
Password of an existing Linux User
key: <string>
Path of the private SSH key in the REST API's Host Node. Valid algorithms: ed25519, rsa, dss
passphrase: <string>
Valid passphrase for the private SSH key provided.
The log-out request needs no request data other than the cookies.
Response data
If the log-in is successful the Access token and CSRF token (if enabled) cookies will be set. The response will include a JSON object with the following data:
Logged in: <boolean>
If the credentials were correct this will be True, otherwise it will return an error message with more details.
status: <string>
If the credentials were correct this will be Success, otherwise it will return an error.
The log-out request will return a JSON the following data:
Logged out: <boolean>
If the Access token was valid, it will return True and invalidate the Access token, otherwise it will return an error message with more details.
status: <string>
If the Access token was valid this will be Success.