Symfony2 login route keeps redirect to https

I was experimenting with FOS user and facebook bundle and when I wanted to go back to my embedded login process something went wrong. Everything should be fine, but when I go to the login / login page it redirects to https (which I didn't include in apache, so it fails).

I didn't find anything in the logs. I thought it must be somewhere outside of my package because the request never got to SecurityController

. I also deleted all FOS related files. Any help would be appreciated.

of security.yml

    firewalls:
    dev:
        pattern:  ^/(_(profiler|wdt)|css|images|js)/
        security: false

    secured_area:
        pattern: ^/
        anonymous: ~
        form_login:
            check_path: /login_check
            login_path: /login
        logout:
            path:   /logout
            target: /
        #remember_me:
        #    key: "%secret%"
        #    lifetime: 31536000
        #    path: /
        #    domain: ~

access_control:
    - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }

      

of routing.yml

login:
    pattern:   /login
    defaults:  { _controller: TnDWWebBundle:Security:login }

login_check:
    pattern:   /login_check

      

+3


source to share


2 answers


You can use the option requires_channel

to force HTTP over HTTPS in security.yml

:

access_control:
    - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: http }

      



http://symfony.com/doc/current/book/security.html#securing-by-channel

0


source


You should try JmikolaInsecureRoutesBundle



0


source







All Articles