Note that there are some explanatory texts on larger screens.

plurals
  1. POSymfony 2: Accessing a firewalled route with two separate providers
    primarykey
    data
    text
    <p>We have a system where the administrators and standard users are handled by their own separate security providers. This has caused a problem in the administrative pages because the administrators can't access any files or images that are behind the main site's firewall unless they are also signed in to the main site.</p> <p>The images and files need to be accessible to all authenticated users and administrators, regardless of provider. They are served through a controller that provides more fine grained access control.</p> <p>Is it possible to define more than one provider to allow access to a route?</p> <p>Here's a stripped down version of our current security.yml:</p> <pre><code>security: providers: admin_user_db: entity: { class: OurAdminUserBundle:AdminUser, property: username } site_user_db: entity: { class: OurSiteUserBundle:SiteUser, property: username } firewalls: admin_login: pattern: ^/admin/login$ security: false site_user_login: pattern: ^/login security: false file_route: pattern: ^/file anonymous: ~ ### We need to allow this route only for authorized users from ### either admin_user_db or site_user_db providers admin_secured_area: pattern: ^/admin http_basic: ~ provider: admin_user_db form_login: check_path: /admin/login_check login_path: /admin/login logout: path: /admin/logout target: / site_secured_area: pattern: .* http_basic: ~ provider: site_user_db form_login: check_path: /check_login login_path: /login failure_path: /login failure_forward: false logout: path: /logout target: / </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload