...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Introduction
URAC micro-service V3 configuration variables that are needed and can be customized
1. Password generation
...
configuration
Info | ||
---|---|---|
| ||
create a custom registry - urac |
You can change the values of the below variables to customize iterations, seeding, and the algorithm used to hash passwords.
Name | Type | Description | Example |
---|---|---|---|
hashIterations | integer | Hashing iteration value used by SOAJS hasher to encrypt/compare passwords | 16 |
seedLength | integer | Seed length value used by SOAJS hasher to encrypt/compare passwords | 32 |
12 | |||
optionalAlgorithm | string | Password Hashing algorithm name"aes-128-cbc-hmac-sha256. "aes256" or "des". You can go to List of Crypto Algorithms to find the name of the algorithm that you can use. |
2. Passport Login variables
Define application keys for passport integration. Currently supporting Twitter, Facebook, and Google. For more information and an example of the configuration, go to Passport Login.
3. Mail Configuration variables
You do not need to set this configuration if you do not want to specify an algorithm | aes256 |
More information can be found in the Complete Example
2. Join & Membership
Info | ||
---|---|---|
| ||
Add to provision - key configuration Create custom registry - urac |
You can change the values of the below variables to customize if you want the user to validate their email once they join or not.
Name | Type | Description | Example | ||
---|---|---|---|---|---|
validateJoin | Boolean | This configuration controllers the status of a user after joining. aka ('pendingJoin' : 'active') | true | ||
membership | Object | This configuration allows you to configure different type of membership that can be set while joining to drive different user configuration like groups (make sure the groups is available). Should be an array of groups. |
|
3. Mail Configuration
Info | ||
---|---|---|
| ||
Add to provision - key configuration Create custom registry - mail & urac |
Mail configuration can be found under two configuration objects:
- SMTP Configuration: Under common fields in order to be used in other microservices not only in URAC. This includes the transport configuration for the mail provider.
- Email Content Configuration: Under URAC configuration in order to customize mail options to handle URAC requirements. This includes links and content of emails sent in each stage.
More information about Variables used, custom data fields used in "content", and examples of the configuration can be found under Mail Configuration
Examples: In provision
Code Block | ||||
---|---|---|---|---|
| ||||
"commonFields" : { "mail" : { // to control the smtp configuration "from": 'me@localhost.com', "transport": {...} }, "sms":{ } } "from": '16170000000', "twilio": { "accountSid": "WWWW", "authToken": "WWWW" } } }, "urac" : { "link": {...}, // this object to control the links in the emails "linksmail": {...} // this object to control the content of the emails "mail": { "join": {...}, //this isJoin the- join emailmail content configuration} "forgotPassword": {...}, //} } } Forgot password mail - content configuration "mailaddUser": {...}, // Add User - mail content configuration "fromchangeUserStatus": 'me@localhost.com', "transport{...}, // Change User Status - mail content configuration "changeEmail": {...} // Change Email - "type": "sendmail"mail content configuration }, "sms": { "optionsinviteToJoin": {...} } } |
Examples: In custom registry
You should create to entries under custom registry (one for mail, one for urac, and one for sms) as follow:
with the following configuration content:
Code Block | ||||||
---|---|---|---|---|---|---|
| "mail": ||||||
{ //urac to mailcontrol optionsthe smtp configuration "join": { "subjectfrom": 'me@localhost.com'Welcome, to SOAJS', "pathtransport": "./mail/urac/join.tmpl" },{...} } |
Code Block | ||||
---|---|---|---|---|
| ||||
{ "forgotPasswordlink": { // this object to "subject": 'Reset Your Password at SOAJS', "pathcontrol the links in the emails "addUser": "...", "changeEmail": "...", "forgotPassword": "...", "inviteToJoin": "../mail/urac/forgotPassword.tmpl", "join": "..." }, "addUsermail": { // this object to control "subject": 'Account Created at SOAJS',the content of the emails "pathaddUser": "./mail/urac/addUser.tmpl"{...}, }, "changeUserStatuschangeEmail": {...}, "subjectchangePin": "Account Status changed at SOAJS",{...}, "changeUserStatus": {...}, //use custom HTML"forgotPassword": {...}, "contentinvitePin": "<p>Dear <b>{{ username }}</b>, <br />Your account status has changed to <b>{{ status }}</b> by the administrator on {{ ts|date('F jS, Y') }}.<br /><br /> Regards,<br/> SOAJS Team. </p>" }, "changeEmail": { "subject": "Change Account Email at SOAJS", "path": "./mail/urac/changeEmail.tmpl" } } |
Variables used, custom data fields used in "content", more information, and examples of the configuration can be found under Mail Notification Configuration
4. Pin configuration variables
...
{...},
"join": {...},
"resetPin": {...}
"inviteToJoin": {...}
},
"sms": {
"inviteToJoin": {...}
}
} |
Code Block | ||||
---|---|---|---|---|
| ||||
{ // to control the smtp configuration
"from": '16170000000',
"twilio": {...}
} |
4. Mail token configuration
Info | ||
---|---|---|
| ||
Add to provision - key configuration Create custom registry - urac |
The URAC sends verification mail with links containing token with expiration date.
Name | Type | Description | Example |
---|---|---|---|
tokenExpiryTTL | milliseconds | This configuration controllers the expiration period for the email links token. | 172800000 |
5. Pin login configuration
Info | ||
---|---|---|
| ||
In provision - key configuration In custom registry |
Pin code adds a second layer of authentication to URAC. For full example, in the hospitality business you want the manager to login and turn on pin login. This way a user can key in a ping and get access. For more information go to Pin login Configuration.
...
6.
...
Data configuration
Resources and database creation steps can be found under Database needed by URAC. More information can be found under the registry configuration layer below.
Configuration Layers and Levels
1. Default Configuration
Default Configuration layer That can be overridden by one of the below configuration layers.
2. Registry Configuration
Table and links to examples
Database needed by URAC
3. Tenant Configuration
Table and links to examples
Link to Complete example
Configuration priority and the default values
This table illustrates the configuration that can be overridden at a different layer of configuration
Info | ||
---|---|---|
| ||
Local → Registry → Tenant
|
Name
Local Configuration (Default)
config.js
...
Registry Configuration (Per Environment)
req.soajs.registry
Tenant Configuration (Per Tenant Per Environment)
...
hashIterations
...
You should add a database configuration to the environment where you deployed URAC. for more information go to Data Configuration.
7. Roaming among main tenants
Info | ||
---|---|---|
| ||
Create custom registry - urac |
You can change the values of the below variable to turn on roaming among main tenants. Either you set masterCode or your set dbCodes.
Name | Type | Description | Example | |||||
---|---|---|---|---|---|---|---|---|
masterCode | String | consolidate all main tenants' user under one master db and create roaming capabilities among them by invitation only. Also this will consolidate all tenants groups under one master db. | "TTTT" | |||||
autoRoaming | Object | To automatically allow roaming among main tenants |
| |||||
dbCodes | Object | To consolidate designated main tenants' users and create roaming capabilities among them by invitation only. for example we have tenant TTT turning on roaming with tCODE1 and tCODE2 |
|