Class Identity
The Identity class is used to manage resource identities, primarily users, within Sentinel. Each user of an enterprise's IT systems should have a set of meta-information available to help identify that user from a security perspective, pursuant to local privacy laws. The Identity object is used to store that information and make some of it available in events, and the rest available through interactive lookups.
The class accepts a pre-defined set of Identity attributes, all of which (except for GUID, which is auto-generated) are optional:
- DistinguishedName: The full expression of the source directory's identity object
- FullName: The full name of the user
- FirstName: The given name of the user
- LastName: The user's surname
- JobTitle: The user's job title
- WorkForceId: The user's workforce identifier
- OfficeCode: The internal postal code used to locate the user
- PrimaryPhone: The user's primary phone contact information
- PrimaryEmail: The user's primary e-mail address
Further, user accounts which belong to this identity can be attached; see the Account
class for further information.
Defined in: identity.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Identity(properties)
Constructs an instance of the Identity class based on passed-in properties.
|
Method Attributes | Method Name and Description |
---|---|
attachAccounts(accounts)
Attaches accounts to the Identity.
|
|
<static> |
Identity.find(params)
Finds the identity.
|
save()
The save methods saves the identity object synchronously.
|
|
<static> |
Identity.saveBatch(identarr, callback)
Save an array of objects in the background, notifying via the callback of any issues.
|
- Parameters:
- {Hash} properties
- Initial properties (JSON notation) to define identity
- See:
- Account
Example:
var myIden = new Identity({ DistinguishedName:"cn=JoeSmith,ou=Active,ou=Users,o=Vault", FullName : "Joe Smith", FirstName : "Joe", LastName : "Smith", JobTitle : "QA", WorkForceId : "95502", OfficeCode : "VVA-100", PrimaryPhone : "703-555-1212", PrimaryEmail : "joesmith@novell.com"}); Account acc1 = new Account({Name:"JoeSmith", Authority:"cn=JoeSmith,ou=Active,ou=Users,o=Vault", Status: "A", CustomerId : 5}) Account acc2 = new Account({Name:"JohnSmith", Authority:"cn=JohnSmith,ou=Active,ou=Users,o=Vault", Status: "A"}) myIden.attachAccounts(new Array(acc1,acc2)); myIden.save();
- Parameters:
- {Account[]} accounts
- Array of Account objects
Example:
var myIdens = Identity.find({DistinguishedName: "cn=JoeSmith,ou=Active,ou=Users,o=Vault"}); var myIdens = Identity.find({FullName : "Joe Smith",FirstName : "Joe"});
- Parameters:
- {JSON} params
- JSON notation of the identity attributes to be matched
- Throws:
- {String}
- Throws an string exception describing the error.
- Returns:
- {Identity[]} Returns an array of Identities found; the array could be of size 0 if no identities are found for the search criteria.
Example:
var myIden = new Identity({ DistinguishedName:"cn=JoeSmith,ou=Active,ou=Users,o=Vault", FullName : "Joe Smith", FirstName : "Joe", LastName : "Smith", JobTitle : "QA", WorkForceId : "95502", OfficeCode : "VVA-100", PrimaryPhone : "703-555-1212", PrimaryEmail : "joesmith@novell.com"}); myIden.save();
- Throws:
- {String}
- Throws an string exception describing the error.
- Returns:
- {GUID} GUID associated with the identity
Example:
var id1 = new Identity({ DistinguishedName:"cn=JoeSmith,ou=Active,ou=Users,o=Vault", FullName : "Joe Smith", FirstName : "Joe", LastName : "Smith", JobTitle : "QA", WorkForceId : "95502", OfficeCode : "VVA-100", PrimaryPhone : "703-555-1212", PrimaryEmail : "joesmith@novell.com"}); var id2 = new Identity({ DistinguishedName:"cn=JohnSmith,ou=Active,ou=Users,o=Vault", FullName : "John Smith", FirstName : "John", LastName : "Smith", JobTitle : "Engineer", WorkForceId : "95504", OfficeCode : "VVA-100", PrimaryPhone : "703-555-1213", PrimaryEmail : "johnsmith@novell.com"}); var callback = function(idenarr,errmessage) { // do something with the original idenarr called with the saveBatch and the errmessage // log(idenarr, errmessage) } var guids = Identity.saveBatch([id1,id2],callback);
- Parameters:
- {Identity[]} identarr
- Array of Identity objects to save (length of array must be <= 100)
- {Callback} callback
- Calls this function when an error occur saving the identities asynchronously