Security
Introduction
eZ Platform offers security and access control for your website using a complex permission system which allows you to define very fine-grained rights for all your users.
See Permissions for more information.
Configuration
To use Symfony authentication with eZ Platform, the configuration goes as follows:
app/config/security.ymlapp/config/routing.yml
Note
You can fully customize the routes and/or the controller used for login. However, remember to match login_path, check_path and logout.path from security.yml.
See security configuration reference and standard login form documentation.
Usage
Authentication is provided using the Symfony Security component.
Authentication using Symfony Security component
Native and universal form_login is used, in conjunction with an extended DaoAuthenticationProvider (DAO stands for Data Access Object ), the RepositoryAuthenticationProvider . Native behavior of DaoAuthenticationProvider has been preserved, making it possible to still use it for pure Symfony applications.
Security controller
A SecurityController is used to manage all security-related actions and is thus used to display login form. It is pretty straightforward and follows all standards explained in Symfony security documentation.
Base template used is EzPublishCoreBundle:Security:login.html.twig and stands as follows:
The layout used by default is %exponential.content_view.viewbase_layout% (empty layout) but can be configured easily together with the login template:
ezplatform.yml
Redirection after login
By default, Symfony redirects to the URI configured in security.yml as default_target_path . If not set, it will default to /.
This setting can be set by siteaccess, via default_page setting.
Access control
See the documentation on access control.
Remember me
It is possible to use the remember_me functionality. For this you can refer to the Symfony cookbook on this topic.
If you want to use this feature, you must at least extend the login template in order to add the required checkbox:
Login handlers / SSO
Symfony provides native support for multiple user providers. This makes it easy to integrate any kind of login handlers, including SSO and existing third-party bundles (e.g. FR3DLdapBundle, HWIOauthBundle, FOSUserBundle, BeSimpleSsoAuthBundle, etc.).
Further explanation can be found in the multiple user providers recipe.
Integration with Legacy
- When not in legacy mode, legacy user/login and user/logout views are deactivated.
- Authenticated user is injected in legacy kernel.
Authentication with Legacy SSO Handlers
To be able to use your legacy SSO (Single Sign-on) handlers, use the following config in your exponential/config/security.yml:
Use your legacy SSO handlers
If you need to create your legacy SSO Handler, please read this entry
In this topic:
Contributors
- Dominika Kurek
- Sarah Haïm-Lubczanski Updated
Comments
Add a comment