dcs / security-core-bundle
The DCSSecurityCoreBundle provides the basic services for the management of security
Installs: 36
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.9
Requires (Dev)
- dcs/user-core-bundle: ~1.0@dev
- phpunit/phpcov: 3.*
- phpunit/phpunit: ^5
- satooshi/php-coveralls: ~1.0
- symfony/security: ~2.8|~3.0
Suggests
- dcs/security-auth-form-bundle: Provides an authentication system using the login form
This package is not auto-updated.
Last update: 2024-11-21 01:45:16 UTC
README
DCSSecurityCoreBundle
The DCSSecurityCoreBundle offers the integration of DCSUser with the Symfony security system.
This bundle provides a custom UserProvider and a custom AuthenticationProvider.
The UserProvider
The UserProvider using the DCS\User\CoreBundle\Repository\UserRepositoryInterface
deals with recovering the user. During the loadUserByUsername action will be emitted two events (before and after the user search) that allow you to insert additional logic.
The AuthenticationProvider
This provider extends the Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider
and adds an event after executing the authenticate method. The AuthenticationProvider is not used directly by this bundle, but is provided as a service in the implementation of a final SecurityFactoryInterface.
See: DCSSecurityAuthFormBundle authentication system that uses the login form.
Events
The complete list of events is within the class DCS\Security\CoreBundle\DCSSecurityCoreEvents
.
Installation
Prerequisites
This bundle requires DCSUserCoreBundle.
Require the bundle
Run the following command:
$ composer require dcs/security-core-bundle "~1.0@dev"
Composer will install the bundle to your project's vendor/dcs/security-core-bundle
directory.
Enable the bundle
Enable the bundle in the kernel:
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new DCS\Security\CoreBundle\DCSSecurityCoreBundle(),
// ...
);
}
Configure
Now that you have properly enabled this bundle, the next step is to configure it to work with the specific needs of your application.
Add the following configuration to your config.yml
.
dcs_security_core:
provider_key: #SECURITY_PROVIDER_NAME
And sets the provider to your security.yml
.
security:
providers:
dcs_user:
id: dcs_security.core.provider.user
# !!Now use the provider in your authentication provider within the firewall!!
Reporting an issue or a feature request
Issues and feature requests are tracked in the Github issue tracker.