I am trying to allow a specific IP to access a restricted path defined in security.yml with no success.
I have these 2 lines in my security.yml:
access_control:
- { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY, ip: "127.0.0.1" }
- { path: ^/.*, role: IS_AUTHENTICATED_FULLY, host: "test.loc" }
However, I am redirected to the login page when I try to access the project on my local.
How can I achieve it?
My guess is that you're running afoul of Chrome's aggressive 301 redirect caching. See a discussion here. Try in another browser such as Firefox.
The problem should go away if you clear Chrome's browsing data. You can also pop in to incognito mode to test.