-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Not fully authenticated when denying IP or host #19906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do you actually have a firewall configure to handle authentication on those paths? |
Sorry, I forgot to include that. Here's my
The authentication on |
From what I see, you don't have a specific firewall on I recommend to add a security:
access_control:
-
path: ^/_internal/secure
roles: IS_AUTHENTICATED_ANONYMOUSLY
allow_if: "'127.0.0.1' == request.getClientIp() or has_role('ROLE_ADMIN')" Additionally I would say that for this controller you can make the exception with /**
* @Route(...)
* @Security("'127.0.0.1' == request.getClientIp() or is_granted('ROLE_ADMIN')")
*/ |
Apologies for the confusion. My route isn't _internal. It is simply /, in both my actual project and my test 2.7 install so that I could make sure I had it set up correctly. |
I still recommend adding |
Hey, thanks for your report! |
Uh oh!
There was an error while loading. Please reload this page.
I have tried on:
The problem:
Attempting to deny access via IP or host through
@Security
or checking$request
inside the controller, oraccess_control
insecurity.yml
produces the same error:The error log:
The same error is thrown on 3.1, which I'm developing my real project on. I don't want the user to be fully authenticated, I want a simple IP address check.
I have followed:
from: http://symfony.com/doc/current/security/access_control.html
I have also tried:
To the same, peculiar effect for both methods. The documentation describes it as I am expecting it to work:
But that's not how it is behaving.
The text was updated successfully, but these errors were encountered: