CleverStack Authentication Module
This CleverStack Module provides users & authentication for the node-seed, it works with either the Object Relational Mapper (clever-orm) AND the Object Document Mapper (clever-odm) Module's.
Out of the box you can use this module with MongoDB, MySQL, MariaDB, PostgreSQL or SQLite! And because this module uses Redis for session storage it's also scalable.
Documentation
See cleverstack.io for more detailed information on the Node seed or visit the Getting Started Guide
Configuration
You can use this module with either the clever-orm (ORM) or clever-odm (ODM) modules, simply add the following config to your /config/local.json (or into your global.json for all environments, or in whatever environment you are using).
Grunt
grunt prompt:cleverAuthConfig
can be used to generate your config for any environment you wantgrunt prompt:cleverAuthSeed
can be used to add/edit users inside your seed data
Configuration files
// For ODM
"clever-auth": {
"driver": "ODM"
}
// For ORM
"clever-auth": {
"driver": "ORM"
}
// Using In-Memory Session Storage
"clever-auth": {
"sessionStoreDriver": "in-memory"
}
// Using Redis for Session Storage
"clever-auth": {
"sessionStoreDriver": "redis",
"redis": {
"host": "localhost",
"port": "6379",
"prefix": "",
"key": ""
}
}
// Using Memcache for Session Storage
"clever-auth": {
"sessionStoreDriver": "redis",
"memcache": {
"host": "localhost",
"port": "11211",
"prefix": ""
}
}
Setup
Using CLI
- Run
clever install clever-auth
and follow the prompts - Run
clever serve
to start your application.
Without CLI
- Clone this repo (or untar it there) into your modules folder (ie modules/clever-auth)
- Add 'clever-auth' to the bundledDependencies array of your app's package.json.
- Run
grunt prompt:cleverAuthConfig
and fill in your configuration options. - Run
grunt prompt:cleverAuthSeed
and create your default user. - Run
grunt db
to rebase and seed the data. - Run
grunt server
to start your application.
Rebuilding (rebasing) and Seeding your database
grunt db:rebaseOrm
will rebase your ORM database (delete and completely replace all tables)grunt db:seedOrm
will seed data into your ORM databasegrunt db:orm
will perform both of the above tasks
Note: You can just run grunt db
, grunt db:rebase
and grunt db:seed
but if the ODM module is installed it will perform these operations on that DB as well (which might be exactly what your looking for)
Test Account Credentials
username: test@cleverstack.io
password: clever
License
See our LICENSE