Note that there are some explanatory texts on larger screens.

plurals
  1. PORedirect loop on any url with https in Symfony2
    text
    copied!<p>Wherever I try to implement the https channel, there will be an infinite redirect loop. This is what the security.yml file looks like:</p> <pre><code>security: encoders: FOS\UserBundle\Model\UserInterface: sha512 role_hierarchy: ROLE_ADMIN: ROLE_USER ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] providers: fos_userbundle: id: fos_user.user_provider.username firewalls: main: pattern: .* form_login: provider: fos_userbundle csrf_provider: form.csrf_provider check_path: /login_check login_path: /login default_target_path: /home logout: path: /logout target: /index security: true anonymous: true remember_me: key: mySecret lifetime: 604800 #seven days path: / domain: ~ access_control: - { path: ^/js, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/css, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/_wdt, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/_profiler, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/index*, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/admin/.*, role: ROLE_ADMIN } - { path: ^/.*, roles: ROLE_USER } </code></pre> <p>For example if I change the admin path to:</p> <pre><code>- { path: ^/admin/.*, role: ROLE_ADMIN, requires_channel: https } </code></pre> <p>the loop will occur. Also in the routing/entity.yml I tried something like this:</p> <pre><code>entity_index: pattern: / defaults: { _controller: MyBundle:Entity:index } schemes: [https] </code></pre> <p>Anybody has an idea how to solve this?</p>
 

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