Log in to ASMS

The AFA REST API uses sessions to avoid re-authenticating with every request. You obtain a session ID in the login response, which is used in all other REST API requests. For example,

  • For base URL, https:://<algosec_server>/afa/api/v1: use the sessionID value from the response as the values of the PHPSESSID parameter in the cookie.

  • For base URL, https://<algosec_server>/fa/server: use the sessionID value from the response as the values of the session parameter in your API requests.

 

Resource Name:

/fa/server/connection/login

Request Method: POST

Request:

Element

Type

Description

username Mandatory

String

AlgoSec Security Management Suite username.

password Mandatory

String

AlgoSec Security Management Suite password.

Response:

Element

Type

Description

SessionID

String

Session ID you will use in all your requests.

status

String

One of the following:

  • true. Indicates login succeeded.
  • false. Indicates login failed.
messageOnly is returned when the request fails.

String

An error message.

Request example

curl -H "Accept: application/json" -k --data "username=ned&password=algosec" 'https://localhost/fa/server/connection/login'

Response example

{
				"status": false,
				"message": "Login Failed: incorrect username or password\n"
				}
				Status: 403
			

Response example

{
"status": true,
			"SessionID": "XXX"
}
				Status: 200