Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

A user is a child object of a domain or unit. A user belongs to a domain or unit, and only one domain or unit only. A user can belong to many groups, however. In a way, a group can be seen as one of the parents of a user.

Anchor
_Toc341972406
_Toc341972406
Attributes

Attribute

type

values

default

mandate

comment

name

string

 

 

true

 

attribute i

 

 

 

false

 

status

string

INACTIVE,
ACTIVE,
LOCKED,
DISABLED

ACTIVE

 

 

description

string

 

 

false

 

domain

object

 

 

true

the domain it belongs to

unit

object

 

 

false

The parent unit

groups

coll

 

 

false

Associated groups

roles

coll

 

 

false

Assigned roles

tokens

coll

 

 

false

Assigned tokens

tokenAssignments

coll

 

 

 

 

tempPasses

Coll<TempPass>

 

 

false

 

qnas

coll

 

 

false

 

siteStamps

coll

 

 

false

 

images

coll

 

 

false

 

certificates

Coll<UserCertificate>

 

 

 

 

lastLogin

date

 

 

 

 

radiusAttributes

coll

 

 

 

 

failCount

integer

 

0

 

 

mustChangePassword

Boolean

 

False

 

 

passwordNeverExpires

Boolean

 

False

 

 

lastChangePassword

date

 

 

 

 



Anchor
_Toc341972407
_Toc341972407
UserCertificate attributes

Attribute

type

values

default

mandate

comment

subjectDn

string

 

 

 

readOnly

serialNumber

integer

 

 

 

readOnly

signature

string

 

 

 

readOnly

issuerDn

string

 

 

 

readOnly

startDate

date

 

 

 

readOnly

expiryDate

date

 

 

 

readOnly

certificatePem

string

 

 

 

readOnly


Anchor
_Toc341972408
_Toc341972408
/user/create

To create a new user, we must specify the name of the user and its parent: either a domain or a user. On success, the method always returns the internal user id of the newly created user.
Parameters:
{
"attrs":{list of attribute value pairs}
}
Response:
{
"error":0,
"result":{"id":the id of the newly created user}
}
Examples:

  1. Creating a user by specifying its parent domain.

Method:/user/create
Parameters:
{
"attrs":
{
"name":"John Smith",
"domain":2
}
}
Response: {"error":0, "result":{"id":1}}

  1. Creating a user specifying its parent unit.

Method:/user/create
Parameters:
{
"attrs":
{
"name":"Joe Blog",
"unit":1
}
}
Response: {"error":0, "result":{"id":2}}

  1. Creating a user with temppass

Method:/user/create
Parameters:
{
"attrs":
{
"name":"Joe Blog",
"unit":1,
"tempPass":
{
"password":"password",
"usageLimit":10
}
}
}
Response:{"error":0, "result":{"id":2}}

Anchor
_/user/search
_/user/search
Anchor
_Toc341972409
_Toc341972409
/user/search

Examples:

  1. Searchusers in a domain

Wiki Markup
Method:/user/search
Parameters: 
\{
 "match":
\[
 \[domain.id", "=", "1"\]
\],
 "return":\["name", "id"\],
 "sort":"name",
 "order":"asc",
 "max": 20,
 "offset": 0
\}
Response: 
\{
 "error":0,
"result":
\[
 \{
  "name":"John Smith",
  "id":"1",
\},
 \{
...
\}
\]
\}
\\

  1. Search users in a unit

Wiki Markup
Method:/user/search
Parameters: 
\{
 "match":
\[
 \[unit.id", "=", "2"\]
\],
 "return":\["name", "id"\],
 "sort":"name",
 "order":"asc",
 "max": 20,
 "offset": 0
\}
Response: 
\{
 "error":0,
"result":
\[
 \{
  "name":"Joe Blog",
  "id":"2",
\},
 \{
...
\}
\]
\}
\\

  1. Search users in a group

Wiki Markup
Method:/user/search
Parameters: 
\{
 "match":
\[
 \[group.id", "=", "2"\]
\],
 "return":\["name", "id"\],
 "sort":"name",
 "order":"asc",
 "max": 20,
 "offset": 0
\}
Response: 
\{
 "error":0,
"result":
\[
 \{
  "name":"Joe Blog",
  "id":"2",
\},
 \{
...
\}
\]
\}
\\

Anchor
_Toc341972410
_Toc341972410
/user/get

Wiki Markup
Method:/user/get
Parameters: 
\{
 "match":
\[
 \["id", "=", 2\],
\],
 "return":\["name", "id"\],
\}
Response: 
\{
 "error":0,
"result":
\{
 "name":"Joe Blog",
 "id":"2",
\}
\}

Anchor
_Toc341972411
_Toc341972411
/user/set

Method:/user/set
Parameters:
{
"id":1,
"attrs":{"email":"john.smith@acme.com"}
}
Response:
{
"error":0
}

Anchor
_Toc341972412
_Toc341972412
/user/delete

Method:/user/delete
Parameters:
{
"id":1
}
Response:
{
"error":0
}
Other methods:
Unit

  1. moveUnit


Group

  1. joinGroup(join/unjoin)


Anchor
_Toc341972413
_Toc341972413
/user/joinGroup

Wiki Markup
Method: /user/joinGroup
Parameters:
\{ 
 "user":\{"id":1\},
 "groups:
\[
\{"id":5\},
\{"id":6\},
\{"id":7\}
\],
 "action":"join | unjoin"
\}
Response: 
\{
 "error":0
\}
\\
\\
+Role+

  1. assignRole(assign/unassign)


Token

  1. assignToken(assign/unassign)

Anchor
_Toc341972414
_Toc341972414
/user/assignToken

Method: /user/assignToken
Assign an existing token
Parameters:
{
"user":{
"id":1,
"domain.id":domainId,
"loginName":loginName
},
"token:{
"id":5,
"product.manufactureCode":mc,
"product.productCode":pc,
"serial":xxx,
},
"credential":{ // optional
"otp":xxxx
},
"autoAssign":true|false,
"action":"assign | unassign",
"isOwner":true | false,
"starts":xxx,
"expires":xxx,
"usageLimit":50,
"status":"active | inactive | disabled",
"pin":"the token pin"
}
Response:
{
"error":0,
"id":tokenAssignmentId
}

Anchor
_Toc341972415
_Toc341972415
/user/resetPassword

Method: /user/assignToken
Assign an existing token
Parameters:
{
"id":"user id",
"attrs":
{
"password":"new password",
"userMustChangePassword":true|false
},
}
Response:
{
"error":0
}

Anchor
_Toc341972416
_Toc341972416
/user/getMessageTemplate


Examples:
Method:/user/getMessageTemplate
Parameters:
{
"user":
{
"domain.name":"xxx"
"loginName":"abc"
},
"templateItemName":"SMTP_OTP"
}
Response:
{
"error":0,
"result":"template in json string"
}

Anchor
_Toc341972417
_Toc341972417
/user/ listProvisioningUrls

Wiki Markup
\\
+Examples:+
Method:/user/ listProvisioningUrls
\\
Parameters: 
\{
"user": 
\{
 "domain.name":"xxx"
"loginName":"abc"
\}
\}
Response: 
\{
 "error":0,
"result":
\{
"total":2,
"rows":
\[
 "[http://provioning.deepnetsecurity.local:8072|http://provioning.deepnetsecurity.local:8072]",
"http://provioning2.deepnetsecurity.local:8073"
\]
\}
\}
\\

Anchor
_Toc341972418
_Toc341972418
/user/import

This method is a task running in the background
Examples:
Method:/user/import
Parameters:
{
"attrs":
{
"format":"csv or xml",
"data":"...",
"charset":"UTF-8"// optional
}
}
Response:
{
"error":0
}

Anchor
_Toc341972419
_Toc341972419
/user/issueCertificate

Method:/user/issueCertificate
Parameters:
{
"user":
{
"loginName":"xxx",
"domain.Name":"somedomain"
},
"csr":"csr data"
"return":
{
"id", "subjectDn"
}
}
Response:
{
"error":0
}

Anchor
_Toc341972420
_Toc341972420
/user/importCertificate

Method:/user/importCertificate
Parameters:
{
"user":
{
"loginName":"xxx",
"domain.Name":"somedomain"
},
"certificate":
{
"data":"..." //PEM format
},
"return":
{
"id", "subjectDn"
}
}
Response:
{
"error":0
}

Anchor
_Toc341972421
_Toc341972421
/user/deleteCertificate

Method:/user/deleteCertificate
Parameters:
{
"user":
{
"loginName":"xxx",
"domain.Name":"somedomain"
},
"certificate":
{
"id":"cert id"
}
}
Response:
{
"error":0
}

Anchor
_Toc341972422
_Toc341972422
/user/getPolicy

Wiki Markup
+Examples:+
Method:/user/getPolicy
Parameters: 
\{
 "user":
\{
"loginName":"login name",
"domain.id":domainid
\},
"category":
\{
 "name":"logon"
\},
 "return":\["name", "id","options"\]
\}
Response: 
\{
 "error":0,
"result":
\{
  "id":"1",
  "name":"System logon policy",
"options":
\{
 "key":"value",
...
\}
\}
\}
\\
\\
\\