-
Notifications
You must be signed in to change notification settings - Fork 1
04. Authentication
At its core, the Jaxon DbAdmin package does not provide the authentication feature.
This is the responsibility of the supporting application.
For the ready-to-use applications, the authentication feature is the provided by the Laravel, Symfony, and Slim frameworks.
Each application ships with the basic default described bellow, which the users can change depending on their specific needs.
The Laravel, Symfony and Slim frameworks can implement a wide range of authentication workflows, from the most basic to the most advanced.
The auth entry in the config/app.php config file is a closure which returns an instance of a class implementing the AuthInterface.
This interface bridges the Jaxon DbAdmin package with the application authentication system, by defining the information it needs about the authenticated user.
The default for the Jaxon DbAdmin Laravel application is to store the users and their credentials in a local SQLite database.
The path to the SQLite database can be set using the DB_DATABASE env var. The specified value is relative to the application root dir, for example:
DB_DATABASE=storage/dbadmin.sqliteThe following Composer script command creates and migrates the database.
composer run dbadmin-create-localdbA CLI command is provided to create a user account in that database.
php artisan user:create --name "Admin" --email "admin@company.com"The command will prompt the user to provide the name and email if the --name and --email options are omitted.
It will then prompt for the account password, and create the account if the provided values are all valid.
The default for the Jaxon DbAdmin Symfony application is to store the users and their credentials in a local SQLite database.
The path to the SQLite database can be set using the DATABASE_URL env var. For example:
DATABASE_URL="sqlite:///%kernel.project_dir%/var/dbadmin.sqlite"
The following Composer script command creates and migrates the database.
composer run dbadmin-create-localdbA CLI command is provided to create a user account in that database.
php bin/console user:create --name "Admin" --email "admin@company.com"The command will prompt the user to provide the name and email if the --name and --email options are omitted.
It will then prompt for the account password, and create the account if the provided values are all valid.
The default for the Jaxon DbAdmin Slim application is to list the users and their credentials in a local json config file.
The path to the users json file can be set using the USERS_JSON_FILE env var. The specified value is relative to the application root dir, for example:
USERS_JSON_FILE=storage/users.json
The encrypted password for each user is defined in its entry.
A CLI command is provided to add a user account in the users file.
php cli/create-user.php --name "Admin" --email "admin@company.com"The command will prompt the user to provide the name and email if the --name and --email options are omitted.
It will then prompt for the account password, and add the account if the provided values are all valid.
Any previous entry with the same email address will first be deleted.