Authentication, SSO, user management, and overall identity solution for Node.js
Authentication, SSO, user management, and overall identity solution for Node.js
Character is a turnkey solution that makes it faster, easier, and cheaper to add a complete user system for your applications:
You don’t have to use all the features. Character is modular, so you can use only the features you need.
Install Character from npm
:
$ npm install character
You also need to install the peer dependencies.
Character exports an Express Router which can be mounted onto any Express 4.x app with app.use
. This is a clean mount which does not interfere with existing routes, because almost all middleware is mounted under /auth
(configurable).
It reads its configuration from character.yml
by default (configurable).
Here is example usage from the Local authenticator example:
// Load Character core and plugins
const character = require('character')()
const authentication = require('character/authentication')
character.use(authentication);
// Attach as Express middleware
app.use(character.create())
// Protect any route with `req.isAuthenticated`
app.get('/restricted', (req, res) => {
if (req.isAuthenticated()) {
res.send('Hello world')
} else {
res.redirect('/login')
}
})
Note how authentication
was added as a plugin. The modular nature of Character makes it easy to build a custom identity solution.
Presently there are two main options for building Node.js applications:
Character combines the key benefits of both options. Install it on your own server and keep control of your own data!
Benefit | Custom solution | Character | Commercial service |
---|---|---|---|
Save R&D time and money with a pre-built solution | ✅ | ✅ | |
Secure your applications with best-practices and security updates | ✅ | ✅ | |
Protect against known vulnerabilities | ✅ | ✅ | |
Use a security-audited and penetration-tested solution | (planned) | ❔ | |
On-premise: comply with your enterprise security requirements | ✅ | ✅ | ❔ |
Open source: verify the code that handles your user data | ✅ | ✅ | |
Keep your user data our of third-party hands | ✅ | ✅ | |
Avoid costly service fees (e.g. for registered but inactive users) | ✅ | ✅ | |
Avoid complicated licensing fee structures | ✅ | ✅ |
This project welcomes contributions from the community. Contributions are
accepted using GitHub pull requests; for more information, see
GitHub documentation - Creating a pull request.
For a good pull request, we ask you provide the following:
Readme.md
file as well.npm run lint
and fix any displayed issues.Create a GitHub issue to report a bug. Please provide sufficient details to reproduce the bug, such as version numbers, error logs, and example code if possible.
If you have discovered a security related bug, please do NOT use the GitHub issue tracker. Send an email to security@characterjs.com.
The lead author is Faraz Syed.
Create a GitHub issue to ask a question. Make sure to add [question]
to the beginning of your issue’s title.
Commercial support is also available:
Commercial support contact: support@characterjs.com