Download the PHP package l3/db-user-bundle without Composer
On this page you can find all versions of the php package l3/db-user-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download l3/db-user-bundle
More information about l3/db-user-bundle
Files in l3/db-user-bundle
Package db-user-bundle
Short Description Database User Provider for CasBundle (authorize many ROLES from UID)
License LGPL-3.0-or-later
Homepage https://github.com/l3-team/DbUserBundle
Informations about the package db-user-bundle
Database Provider for CAS
Allow authorize many ROLES (Symfony ROLES) from UID (returned by CasBundle or CasGuardBundle) for application Symfony2, Symfony3 and Symfony4 and Symfony5 and Symfony6 and Symfony7
- UID is the id user returned by jasig cas sso server and by the l3-team/CasBundle or l3-team/CasGuardBundle (repository github) or l3/cas-bundle or l3/cas-guard-bundle (repository packagist)
- ROLES are Symfony ROLES prefixed by ROLE_, example ROLE_ADMIN, ROLE_USER, etc...
Installation of the Bundle
- Install the Bundle with this command :
Launch the command composer update to install the package.
-
For Symfony 2 and 3 : add the Bundle in the AppKernel.php file.
-
For Symfony 4 and 5 and 6 and 7 : Verify if the line are present in config/bundles.php file (if not present, just add the line) :
- Next, configure the database connection :
-
For Symfony 2 and Symfony 3, in parameters.yml (fills the variables named prefixed by database*) :
-
For Symfony 4 and 5 and 6 and 7, adapt the variable name DATABASE_URL in .env.local :
- And create the 3 tables (x_user, x_role and x_user_role) with this command(s) :
-
For Symfony 2 :
- For Symfony 3 and Symfony 4 and Symfony 5 and Symfony 6 and Symfony 7 :
Configuration of the bundle
-
For Symfony 2 and 3 : in the firewall of your application, use the Bundle :
-
For Symfony 4 and 5 : in the firewall of your application, use the Bundle :
- For Symfony 6 and 7 : in the firewall of your application, use the Bundle :
Anonymous mode
if your application use the anonymous mode of the CasBundle (special username __NO_USER__), then configure the security file like this :
For Symfony 6 and Symfony 7 :
In Symfony4, if you use chain_provider, you should set provider name on all entry (ie l3_firewall and main) firewall (where security is active : security: true) in config/packages/security.yaml like this :
How to use
3 tables x_user, x_role and x_user_role have been created with the doctrine command schema update.
- table x_user contains the UID used with CasBundle or CasGuardBundle
- table x_role contains all the ROLES Symfony
- table x_user_role contains the map of all ROLES of all UID