Database Name | Database Type | Collection Name |
---|
%tenant_code%_urac | MongoDB | users |
Record Explanation
| Field Name | Type | Mandatory | Unique | Indexed | Description |
---|
_id | Mongo ID | YES | YES | YES | Mongo Record ID |
username | String | YES | YES | YES | The UserName |
password | Hash | YES | NO | NO | The User Password |
firstName | String | YES | NO | NO | The User First Name |
lastName | String | YES | NO | NO | The User Last Name |
email | String | YES | YES | YES | The User Email |
status | String | YES | NO | NO | The User Status pendingNew or active |
profile | Object | NO | NO | NO | Additional User Info. |
socialId | Object | NO | NO | NO | Holds the 3rd party information aka facebook, twitter, ... |
config | Object | NO | NO | NO |
|
|
| Field Name | Type | Mandatory | Unique | Indexed | Description |
---|
allowedTenants | Array | NO | NO | NO | Sub tenant access | keys | Object | YES | NO | NO | Overridden ACL Keys | packages | Object | NO | NO | NO | Overridden ACL Packages |
|
| Field Name | Type | Mandatory | Unique | Indexed | Description |
---|
%packageName% | Object | NO | NO | NO |
|
|
| Field Name | Type | Mandatory | Unique | Indexed | Description |
---|
acl | Object | NO | NO | NO |
|
|
| Field Name | Type | Mandatory | Unique | Indexed | Description |
---|
access | Boolean or Array | NO | NO | NO |
| apisPermission | String | NO | NO | NO |
| apis | Object | NO | NO | NO |
|
|
| Field Name | Type | Mandatory | Unique | Indexed | Description |
---|
%apiRoute% | Object | YES | NO | NO |
|
|
| Field Name | Type | Mandatory | Unique | Indexed | Description |
---|
access | Object | NO | NO | NO |
|
|
|
|
|
|
|
tenant | Object | YES | NO | NO |
|
|
| Field Name | Type | Mandatory | Unique | Indexed | Description |
---|
id | String | YES | NO | NO | Tenant ID | code | String | YES | NO | NO | Tenant Code |
|
groups | Array | YES | NO | NO | Array Of Group Codes |
ts | Time stamp | YES | NO | NO | record created timestamp |
Social ID
When you turn on 3rd party login integration, the user is added to URAC with socialId object that holds the 3rd party information as follow:
{
...
socialId : {
"facebook": {
"id": "10153921831136546",
"ts": 1563462760715,
"email" : {
"modified" : true
},
"originalProfile" : { / The original profile @ facebook / },
"accessToken": "EAAEtfZBue5g4BAHxZC795RjLBHzM044Rd1lqJDMUzj1FNDkZD"
},
"google": {
"id": "116534884477427572518",
"ts": 1563462760715,
"email" : {
"modified" : true
},
"originalProfile" : { / The original profile @ google / },
"accessToken": "ya29.Ci-gA_tPPWbT0qp5a3z4UwqzyIj1hQsMUuQ03mAmXFZQnVcaRsrmqJzK10oeBeIYGg",
"refreshToken": "1/CnxzVU1kKh5NQsIJT5Mv2LkGguGCQqpVgwB0MuG7Qhc"
}
...
}
...
}
Sample
- This User has only access to the main tenant "DBTN" with the pin code (5511) but has no access to subtenants
{
"_id": ObjectId("5d308c68687aaf05b1c24097"),
"locked": true,
"username": "owner",
"password": "$2a$12$geJJfv33wkYIXEAlDkeeuOgiQ6y6MjP/YxbqLdHdDSK7LDG.7n7Pq",
"firstName": "owner",
"lastName": "owner",
"email": "me@localhost.com",
"ts": 1563462760715,
"status": "active",
"profile": {},
"groups": [
"owner"
],
"config": {
"packages": {},
"keys": {}
},
"tenant": {
"id": "5c0e74ba9acc3c5a84a51259",
"code": "DBTN"
"pin": {
"code": 5511,
"allowed": true
}
},
"lastLogin": 1564068005777
};
2. This user has access to the main tenant "DBTN" in the group "Owner" and as well has access to subtenants like "TES1" with the code (5678) and group "sub"
{
_id: ObjectId("5d3820639f9655752c03e340"),
locked: true,
username: "devop",
firstName: "Antoine",
lastName: "Hage",
email: "test@localhost.com",
status: "active",
config: {
allowedTenants: [
{
tenant: {
id: "5c0e74ba9acc3c5a84a51251",
code: "TES1",
pin: {
code: "5678",
allowed: true
}
},
groups: [
"sub"
]
},
{
tenant: {
code: "TES0",
id: "5c0e74ba9acc3c5a84a51259"
}
},
{
tenant: {
id: "THYME_tID",
code: "THYME_CODE",
pin: {
code: "5677",
allowed: true
}
},
groups: [
"waiter"
]
},
{
tenant: {
id: "ELVIRA_tID",
code: "ELVIRA_CODE"
},
groups: [
"manager"
]
}
]
},
tenant: {
id: "5c0e74ba9acc3c5a84a51259",
code: "DBTN",
pin: {
code: "5621",
allowed: true
}
},
"groups": [
"owner"
],
}