-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security][Framework] Use Firewall Settings to get UserProvider Service for Request #54713
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
Let your controller extend Docs: https://symfony.com/doc/current/controller.html#the-base-controller-class-services |
The Feature I would like was to get the UserProviderService for the Current Firewall Not the Current User |
Sorry, my bad. I found a note in the docs:
Source: https://symfony.com/doc/current/security.html#loading-the-user-the-user-provider |
the Problem is still getting the right name/service For Example A, if the firewall uses multiple Providers, the Firewall Service gets a Chained Provider === Hm i think i found the Service I was looking for: |
That clarifies a bit more. So you don't want to get the Your code should not rely on the implementation, but use the interface method it provides. Let's say you have two firewalls:
You can get access to "chained" or "ldap" by referencing the service, but you cannot determine that "chained" used "entity" internally. Just re-use "chained" as-it and let it iterate through the internal user providers again. Also I don't see a use-case where you have to use different user providers for different firewalls and cannot rely on chained provider to search for other users. You may create your own implementation that acts like a chained provider, returns a wrapped |
@n0rbyt3 my goal: have some UserProvider implement my interface, for example then i can use the Firewall Config + the
that is the problem i am seeing right now, that i don't have a way to access the Chained Provider?
I may not rely on loadUserByIdentifier from the UserProviderInterface My main Idea was not to have something that can be generated via something like the MakerBundle, but have the router/firewall handle the problem. example: |
Thank you for this suggestion. |
Friendly reminder that this issue exists. If I don't hear anything I'll close this. |
i would still like to do that feature my main goal would be to not need to create a Controller for each of my firewalls, |
Description
#46066 Allows to get the Firewall Config for a given Request, but the UserProvider is a string and doesn't give me the Service instance.
What I want, is to get the UserProvider (if able) for the current Firewall.
Either via a Service, or via RequestResolver.
Example:
Example
No response
The text was updated successfully, but these errors were encountered: