/api/login


Log user in using SSH username and password
For more information see  Login process state machine and keyboard-interactive

Method

POST

Parameters

  • username — the ssh username
  • password — (optional) the password
  • serverId  — (optional) serverId of the host you want to log in to  (found by calling /api/server)
  • usePK    — (optional) enable public-key authentication
  • basic — (optional, default false) Use basic authentication See Web Client Authentication

Result

Result

JSON object.  The object contains different members depending on the authentication stage.  Authentication has not completed until the ‘success’ stage has been reached.

Stage: public-key

User is in the middle of authentication.
Send the public key to the server

  • stage — ‘public-key’
  • token — connection token which is required during authentication

Stage: keyboard-interactive

User is in the middle of authentication.
The prompts parameter contains an array of prompts that the user should make responses to.  Send the array of responses to /api/login/keyboard-interactive/:token

  • stage — ‘keyboard-interactive’
  • token — connection token which is required during authentication
  • prompt — text description of the prompt

Stage: password

Password based authentication

JSON object with the following members

  • stage — ‘password’
  • token — connection token which is required during authentication

Stage: success

User has successfully logged in and can now issue api commands

JSON object with the following members

  • stage — ‘success’
  • token — connection token which is required in api calls
  • host —  hostname where the user is connected