Tenable Security Center API: Token

 

/token

Methods

POST

Logs the specified User into Tenable.sc and establishes a token for subsequent requests.

NOTE #1: Subsequent requests up to and including /token::DELETE should set the token as the value of the "X-SecurityCenter" HTTP header field

NOTE #2: The value for unassociatedCert will be "true" if a certificate is present and not associated with any user. You may then associate the certificate with the current user.

NOTE #3: On response if releaseSession returns "true", the user has reached its maximum login limit.

NOTE #4: For information on logging in with a client certificate, see /system::GET.

Request Parameters
Expand
{
	"username" : <string>,
	"password" : <string>,
	"releaseSession" : <boolean> DEFAULT false
}
Example Response - Available session for user to login
Expand
{
	"type" : "regular",
	"response" : {
		"failedLoginIP": "255.255.255.255"
		"failedLogins": "1"
		"lastFailedLogin": "1452889027"
		"lastLogin": "1452884944"
		"lastLoginIP": "255.255.255.255"
		"token" : 123456789,
		"unassociatedCert" : "false"
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1403115433

}

Example Response - No sessions available for user to login

Expand
 {
   "type":"regular",
   "response":{
      "releaseSession":true
   },
   "error_code":0,
   "error_msg":"",
   "warnings":[

   ],
   "timestamp":1453406894
}


DELETE

Deletes the token associated with the logged in User.

Request Parameters

None

Example Response
Expand
{
	"type" : "regular",
	"response" : "",
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1403116505
}