Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

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

namefirstName

string



true


lastName

attribute istring



falsetrue


statusloginName

string



INACTIVE, trueACTIVE,


password

LOCKED, stringDISABLED



true

ACTIVE


descriptionemail

string



false


domainmobile

objectstring

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





twitter

string





telephone

string





canonicalName

string





userPrincipalName

string





personalEmail

string





personalTelephone

string





personalTwitter

string





personalMobile

string





userLocalestring





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

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 unit. On success, the method always returns the internal user id of the newly created user.

...

Code Block
languagejs
titleResponse
{
    "error":0,
    "result":{"id":"the id of the newly created user"}
}

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

Examples:

Note: in the following examples, you can use any "searchable" attributes in user as the match condition, not only the attributes in the example.

e.g.

["loginName", "=", "john"]

or

["email", "=", "john@acme.com"]


  1. Search users in a domain

    Code Block
    languagejs
    titleParameters
    {
       

    Search users in a domain

    Code Block
    languagejs
    titleParameters
    {
        "match":
        [
             [domain.id", "=", "domain id 1"],
             ["lastName", "=", "Smith"]
        ],
        "return":["id", "loginName", "email"],
        "sort":"nameloginName",
        "order":"asc",
        "max": 20,
        "offset": 0
    }


    Code Block
    languagejs
    titleResponse
    {
        "error":0,
        "result":
        {
            "total": 20,
            "rows":
            [
               	 {
                    "id":"user id 1", 
                    "loginName":"John Smith",
                    "email": "john.smith@acme.com"
         	}    },
                	{
                    "id":"user id 2", 
                    "loginName":"Alice Smith",
                    "email": "alice.smith@acme.com"
                	}, 
         	    ...
            ]
        }
    }


  2. Search users in a unit

    Code Block
    languagejs
    titleParameters
    {
        "match":
        [
             [unit.id", "=", "unit id 1"],
        ],
        "return":["id", "loginName", "email"],
        "sort":"nameloginName",
        "order":"asc",
        "max": 20,
        "offset": 0
    }


    Code Block
    languagejs
    titleResponse
    {
        "error":0,
        "result":
        [{
        	{
          "total": 20,
            "rows":
            [
                {
                    "id":"user id 1", 
                    "loginName":"John Smith",
                    "email": "john.smith@acme.com"
         	    },
         	{
              {
                    "id":"user id 3", 
                    "loginName":"Bob Smith",
                    "email": "bob.smith@acme.com"
                	}, 
         	    ...
            ]
        }
    }


  3. Search users in a group

    Code Block
    languagejs
    titleParameters
    {
        "match":
        [
             [group.id", "=", "group id 1"],
        ],
        "return":["id", "loginName", "email"],
        "sort":"nameloginName",
        "order":"asc",
        "max": 20,
        "offset": 0
    }


    Code Block
    languagejs
    titleResponse
    {
        "error":0,
        "result":
        [{
        	{
            "total": 20,
            "rows":
            [
                {
                    "id":"user id 1", 
                    "loginName":"John Smith",
                    "email": "john.smith@acme.com"
         	    },
         	{
              {
                    "id":"user id 32", 
                    "loginName":"BobAlice Smith",
                    "email": "bobalice.smith@acme.com"
          	      }, 
         	    ...
            ]
        }
    }


Anchor
_Toc341972410
_Toc341972410
/user/get

...

Method: /user/get

Code Block
languagejs
titleParameters
{
   
Parameters: 
\{
 "match":
\    [
 \["         [domain.id", "=", 2\"domain id 1"],
\],
 "return":\["name"         [id", "id"\],
\}
Response: 
\{
 "error":0,
"result":
\{
 "name":"Joe Blog",
 "id":"2",
\}
\}

...

=", "user id 1"] // or ["loginName", "=", "john"] etc, any searchable user attributes can be used as the match condition
    ],
    "return":["id", "loginName", "email"]
}


Code Block
languagejs
titleResponse
{
    "error":0,
    "result":
    {
        "id":"user id 1", 
        "loginName":"John Smith",
        "email": "john.smith@acme.com"
    }
}


Anchor
_Toc341972411
_Toc341972411
/user/set

Method:/user/set

Code Block
languagejs
titleParameters
{
    "id":"user id 1",
    "attrs": {"email": "john.smith@acme.com"}
}


Code Block
languagejs
titleResponse
{
    "error":0
}

Anchor
user_disable
user_disable
/user/disable

Method:/user/disable

Code Block
languagejs
titleParameters
{
    "id":"user id 1"
}


Code Block
languagejs
titleResponse
{
    "error":0
}

Anchor
user_enable
user_enable
/user/enable

Method:/user/enable

Code Block
languagejs
titleParameters
{
    "id":"user id",
    "authorizationCode": "Authorization Code"
}


Code Block
languagejs
titleResponse
{
    "error":0
}

Anchor
_Toc341972412
_Toc341972412
/user/delete

Method:/user/delete

Code Block
languagejs
titleParameters
{
    "id":"user id 1"
}


Code Block
languagejs
titleResponse
{
    "error":0
}


Anchor
_Toc341972413
_Toc341972413
/user/joinGroup

Method: /user/joinGroup

Code Block
languagejs
titleParameters
{
    "user":{"id":1},
    "groups":
    [
        {"id":"id1"},
        {"id":"id2"}
    ],
    "action":"join | unjoin"
}


Code Block
languagejs
titleResponse
{
    "error":0
}

Anchor
_Toc341972414
_Toc341972414
/user/assignToken

Method: /user/assignToken
Assign an existing token

Code Block
languagejs
titleParameters
{
    "user":{"id":"user id 1"},
    "token:
    {
        "id":"token 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"
}


Code Block
languagejs
titleResponse
{
    "error":0,
    "id":"tokenAssignmentId"
}


Anchor
_Toc341972415
_Toc341972415
/user/resetPassword

Method: /user/resetPassword

Code Block
languagejs
titleParameters
{
    "user":{"id":"user id 1"},
    "attrs":
    {
        "password":"new password",
        "userMustChangePassword":true|false
    }
}


Code Block
languagejs
titleResponse
{
    "error":0
}

Anchor
_Toc341972416
_Toc341972416
/user/getMessageTemplate


Examples:
Method:/user/getMessageTemplate

Code Block
languagejs
titleParameters
{
    "user":{"id":"user id 1"},
    "templateItemName":"SMTP_OTP"
}


Code Block
languagejs
titleResponse
{
    "error":0,
    "result":"template in json string"
}


Anchor
_Toc341972417
_Toc341972417
/user/ listProvisioningUrls


Code Block
languagejs
titleParameters
{
    "user":{"id":"user id 1"}
}


Code Block
languagejs
titleResponse
{
    "error":0,
    "result":
    {
        "total": 2,
        "rows":
        [
            "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

Code Block
languagejs
titleParameters
{
    "attrs":
    {
        "format":"csv or xml",
        "data":"...",
        "charset":"UTF-8"// optional
    }
}


Code Block
languagejs
titleResponse
{
    "error":0
}


Anchor
_Toc341972419
_Toc341972419
/user/issueCertificate

Method:/user/issueCertificate

Code Block
languagejs
titleParameters
{
    "user":{"id":"user id 1"},
    "csr":"csr data",
    "return":
    [
       "id", "subjectDn"
    ]
}


Code Block
languagejs
titleResponse
{
    "error":0,
    "result":
    {
        "id": "cert id",
        "subjectDn": "the subject dn"
    }

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

...

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

  1. moveUnit

...

  1. joinGroup(join/unjoin)

...

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)

...

  1. assignToken(assign/unassign)

...

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
}

...

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"
\]
\}
\}
\\

...

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
_Toc341972420
_Toc341972420
/user/importCertificate

Method:/user/importCertificate

Code Block
languagejs
titleParameters

...

{
    "user":{"id":"user id 1"},
    "certificate":
    {
        "data":"data in PEM format"
    },
    "return":
    [
       "id", "subjectDn"
    ]
}


Code Block
languagejs
titleResponse
{
    "error":0,
    "result":
    {
        "id": "cert id",
        "subjectDn": "the subject dn"
    }
}

Anchor
_Toc341972421
_Toc341972421
/user/deleteCertificate

Method:/user/deleteCertificate

Code Block
languagejs
titleParameters

...

{

...


    "user":

...

{

...

"

...

id":"

...

user id 1"},
    "certificate":

...


    {
        "id":"cert

...

 id"
    }
}


Code Block
languagejs
titleResponse
{
    "error":0

...


}

Anchor
_Toc341972422
_Toc341972422
/user/getPolicy

...

...

Method: /user/getPolicy

Code Block
languagejs
titleParameters
{
   
Parameters: 
\{
 "user":
\{
"loginNameid":"login name",
"domain.id":domainid
\user id 1"},
    "category":
\    {
       "name":"logon"
\    },
    "return":\["name", "id","options"\]
\}
}


Code Block
languagejs
titleResponse
{
   Response: 
\{
 "error":0,
    "result":
\{
    {
        "id": "1policy id",
        "name": "Systempolicy logon policyname",
        "options":
\{
 "key":"valueoptions",
...
\}
\
    }
\}
\\
\\
\\