N
N
nemovalex2020-05-13 06:21:25
symfony
nemovalex, 2020-05-13 06:21:25

Symfony Security infinite redirect?

 When I go to the login URL, the page does not load for me and the browser gives an ERR_TO_MANY REDIRECTS error.
5ebb673795367263248381.png
I set up authentication:

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

        main:
            anonymous: lazy
            provider: app_user_provider
            form_login:
                check_path: loginAction
                login_path: loginAction
            logout:
                path: /logout
                target: loginAction
            # guard:
            #     authenticators:
            #         - App\Security\ClearAuthenticator
            # activate different ways to authenticate
            # https://symfony.com/doc/current/security.html#firewalls-authentication

            # https://symfony.com/doc/current/security/impersonating_user.html
            # switch_user: true

    # Easy way to control access for large sections of your site
    # Note: Only the *first* access control that matches will be used
    access_control:
        # - { path: ^/admin, roles: ROLE_ADMIN }
        # - { path: ^/profile, roles: ROLE_USER }
         - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
         - { path: ^/admin, roles: ROLE_ADMIN }

I gave access in access_control to anonymous users but still why is there a redirect loop?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question