Back to TOC
Note: Even if Concorda microservice is offering all required services for client authentication, in order to fully use the Concorda's features (includes user management, runtime configurations and others) you can use also Concorda Administration Dashboard, that can be installed and started as a separate application.
Install Concorda module in your application
npm install --save concorda
then
const Concorda = require('concorda')
module.exports = function (options) {
var seneca = this
seneca
.use(Concorda, {
appkey: 'concorda',
auth: {
restrict: '/api',
password: process.env.COOKIE_PASSWORD || 'some long password'
}
})
return {
name: 'your-plugin'
}
}
When using it as a Seneca plugin some options should be passed to control various features of Concorda.
appkey
- the application key - leave it with 'concorda' as this application is create by default in the DB. If you want another application key, plate create another application and set corresponding appkey here.publicRegister
- allowed values "0"/"1" - disable/enable public user register. If public register is disabled ("0") then user register can be done only based on user invitation.USER_POLICY
- this will define the user policy..activateAccount
- allowed values "0"/"1" - force account activation from confirm register emailforceChangePassword
- allowed values "0"/"1" - force user change password on first login if password was auto-generated on register.
passwordPolicy
- this will define the password policy to be used to enforce stronger user passwords.requireLowercase
- allowed values "0"/"1" - activate if lowercase characters are required in passwordrequireUppercase
- allowed values "0"/"1" - activate if uppercase characters are required in passwordrequireNumeric
- allowed values "0"/"1" - activate if numeric characters are required in passwordminLength
- numeric value - minimum length for user passwords.
authType
- this will define the allowed authentication types.google
- allowed values "0"/"1" - disable/enable google logingithub
- allowed values "0"/"1" - disable/enable github logintwitter
- allowed values "0"/"1" - disable/enable twitter login
emailTemplateFolder
- absolute path to mail template folder. Example of mail templates can be found here
An example of default settings used internally be Concorda is:
{
"publicRegister": "1",
"authType": {
"google": "0",
"github": "0",
"twitter": "0"
},
"configured": true,
"passwordPolicy": {
"requireLowercase": "0",
"requireNumeric": "0",
"requireUppercase": "0",
"minLength": 6
},
"emailTemplateFolder": "/home/malex/workspace/nearForm/concorda/concorda/lib/email-templates/"
}
- By default the following user is added to Concorda as part of initial setup: [email protected]/concorda
- It is very important that after you started Concorda for the first time to login and change administrator password and e-mail.
A demo project that is using the Concorda as plugin can be found here.