-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DX][Security] Check for server PHP_AUTH_USER #13950
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
|
Enabling http_basic authentication for that route could indeed solve this, but it would be a nice feature if such an easy check can be handled via annotations 👍 So, you think an annotation for such basic authentication checks is a no-go? |
@rvanlaak the issue is that you are asking to mix the authentication and the authorization in the annotation, while they are different concerns. |
Doesn't has to be the same annotation, the following would also be great.
But I notice you aren't convinced of the ease this would offer? 👍 |
@rvanlaak Correct "username" and "password" are not "authorization" concerns.
Please read the docs to understand more about this topic:
Actually this link covers exactly what you're trying to achieve (basic auth): You can also use annotations to require specific role(s) for the controller: |
Thanks @MacDada , but I was well aware of most of those pages. My proposition would be to have a specific annotation to check for authentication parameters, to reduce boilerplate code. As nobody sees this as a viable usecase, I'll close this issue. |
For a server-side payment notification service we authorize the
$request->server
parametersPHP_AUTH_USER
andPHP_AUTH_PW
. For complex security annotations we can always implement the Annotations of the JMSSecurityExtraBundle, but this seems a bit too much for this simple use-case:What I'd like to propose is that the
@Security
annotation is able to compare the server parameters with the values from the container parameters:The text was updated successfully, but these errors were encountered: