SecurityCenter API: Current User

/currentUser

Methods

GET

Gets the Current User.

Fields Parameter
Expand

The fields parameter should be specified along the query string, and it takes the syntax

    ?fields=<field>,...

NOTE: The 'userPrefs' field duplicates the 'preferences' field.

Allowed Fields

*id
**username
**firstname
**lastname
**status
role
title
email
address
city
state
country
phone
fax
createdTime
modifiedTime
lastLogin
lastLoginIP
mustChangePassword
locked
failedLogins
authType
fingerprint
password
description
managedUsersGroups
managedObjectsGroups
userPrefs
preferences
organization

ldapUsername
ldap

Session user is not role "1" (Administrator)

responsibleAsset
group

Legend

* = always comes back

** = comes back if fields list not specified on GET all
Request User Parameters

None

Example Response
Administrator
Expand
{
	"type" : "regular",
	"response" : {
		"id" : "1",
		"status" : "0",
		"username" : "admin",
		"ldapUsername" : "",
		"firstname" : "Admin",
		"lastname" : "User",
		"title" : "Application Administrator",
		"email" : "",
		"address" : "",
		"city" : "",
		"state" : "",
		"country" : "",
		"phone" : "",
		"fax" : "",
		"createdTime" : "1432921843",
		"modifiedTime" : "1453473716",
		"lastLogin" : "1454350174",
		"lastLoginIP" : "172.168.0.0",
		"mustChangePassword" : "false",
		"locked" : "false",
		"failedLogins" : "0",
		"authType" : "tns",
		"fingerprint" : null,
		"password" : "SET",
		"managedUsersGroups" : [],
		"managedObjectsGroups" : [],
		"preferences" : [
			{
				"name" : "timezone",
				"value" : "Americaew_York",
				"tag" : ""
			}
		],
		"organization" : {
			"id" : 0,
			"name" : "SecurityCenter Administration",
			"description" : ""
		},
		"userPrefs" : [
			{
				"name" : "timezone",
				"value" : "Americaew_York",
				"tag" : ""
			}
		],
		"role" : {
			"id" : "1",
			"name" : "Administrator",
			"description" : "Role defining an administrator of the application"
		},
		"group" : {
			"id" : -1,
			"name" : "",
			"description" : ""
		},
		"ldap" : {
			"id" : -1,
			"name" : "",
			"description" : ""
		}
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1454350604
}	
Organization User
Expand
{
	"type" : "regular",
	"response" : {
		"id" : "1",
		"status" : "0",
		"username" : "head",
		"firstname" : "",
		"lastname" : "",
		"title" : "",
		"email" : "",
		"address" : "",
		"city" : "",
		"state" : "",
		"country" : "",
		"phone" : "",
		"fax" : "",
		"createdTime" : "1433519288",
		"modifiedTime" : "1453477493",
		"lastLogin" : "1454349916",
		"lastLoginIP" : "172.20.0.0",
		"mustChangePassword" : "false",
		"locked" : "false",
		"failedLogins" : "0",
		"authType" : "tns",
		"fingerprint" : null,
		"password" : "SET",
		"managedUsersGroups" : [
			{
				"id" : "-1",
				"name" : "All Groups",
				"description" : "All Groups"
			}
		],
		"managedObjectsGroups" : [
			{
				"id" : "-1",
				"name" : "All Groups",
				"description" : "All Groups"
			}
		],
		"preferences" : [
			{
				"name" : "timezone",
				"value" : "Americaome",
				"tag" : "system"
			}
		],
		"organization" : {
			"id" : 1,
			"name" : "org1",
			"description" : ""
		},
		"userPrefs" : [
			{
				"name" : "timezone",
				"value" : "Americaome",
				"tag" : "system"
			}
		],
		"role" : {
			"id" : "2",
			"name" : "Security Manager",
			"description" : "The Security Manager role has full access to all actions at the organization level. A Security Manager has the ability to create new groups and manage existing ones. A Security Manager can also define how users interact with other groups.\n\nThe ability to manage other users and their objects can be configured using group permissions on the Access tab of User add/edit. This includes viewing and stopping running scans and reports."
		},
		"responsibleAsset" : {
			"id" : "19",
			"name" : "Windows Hosts",
			"description" : "The operating system detected has Windows installed.\n\nThis will be helpful for those getting started with SecurityCenter."
		},
		"group" : {
			"id" : "0",
			"name" : "Full Access",
			"description" : "Full Access group"
		}
	},
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1454350550
}

PATCH

Edits the current User, changing only the passed in fields.

Request Parameters
Expand
(All fields are optional)


{
	"firstname" : <string> DEFAULT "",
	"lastname" : <string> DEFAULT "",
	"title" : <string> DEFAULT "",
	"email" : <string> DEFAULT "" (required to be present and valid if emailNotice is not empty and is not "none"),
	"address" : <string> DEFAULT "",
	"city" : <string> DEFAULT "",
	"state" : <string> DEFAULT "",
	"country" : <string> DEFAULT "",
	"phone" : <string> DEFAULT "",
	"fax" : <string> DEFAULT "",
	"fingerprint" : <string> DEFAULT null,
	"emailNotice" :  <string> "both" | "id" | "none" | "password" DEFAULT "",
	"password" : <string> (must meet the requirements for configuration setting, "PasswordMinLength"),
	"preferences" : [
		{
			"name" : <string>,
			"tag" : <string> DEFAULT "",
			"value" : <string>
		}...
	]
}
Example Response
See /currentUser::GET


/currentUser/associateCert

Methods

POST

Associates a certificate that was presented to the server with the user's account, allowing for auto-login.

Note: When askAboutCert="true", then the F/E would allow you to save fingerprint

Request Parameters

Active Certificate (CAT Card, etc).

Example Response

See /currentUser::GET

/currentUser/preferences

Methods

GET

Gets the Current User's preferences specified by parameters 'name' and/or 'tag'. If neither name nor tag is provided, this gets all of the Current User's preferences.

NOTE: This functionality may also be performed in /currentUser::GET with the field 'preferences'

Request Parameters
Expand

Parameters must be passed in as query string (as opposed to JSON) in the format of: /currentUser/preferences?name=foo&tag=foo

{
	"name" : <string> OPTIONAL,
	"tag" : <string> OPTIONAL
}
Example Response


Expand
{
    "type" : "regular",
    "response" : [
        {
            "name" : "timezone",
            "value" : "America\ew_York",
            "tag" : ""
        }
    ],
    "error_code" : 0,
    "error_msg" : "",
    "warnings" : [],
    "timestamp" : 1409327492
}

DELETE

Deletes the Current User's preferences specified by parameters 'name' and/or 'tag'. If neither name nor tag is provided, this deletes all of the Current User's preferences.

NOTE : This functionality may also be performed in /currentUser::PATCH with the field 'preferences'

Request Parameters
Expand
{
	"name" : <string> OPTIONAL,
	"tag" : <string> OPTIONAL
}
Example Response


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

PATCH

Edits or adds the preferences associated with the Current User, changing only the passed in fields.

NOTE #1: If the given preference name/tag combination exists, this will update the value. Otherwise, the preference provided will be added.

NOTE #2 : This functionality may also be performed in /currentUser::PATCH with the field 'preferences'

Request Parameters
Expand
{
	"name" : <string>,
	"tag" : <string> DEFAULT "",
	"value" : <string>
}
Example Response


Expand
{
	"type" : "regular",
	"response" : [
		{
			"name" : "TestNewPreference",
			"value" : "test",
			"tag" : ""
		}
	],
	"error_code" : 0,
	"error_msg" : "",
	"warnings" : [],
	"timestamp" : 1410977629
}