-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[cookbook] Error in "custom Authentication Provider" listener code (and proposed fix) #3212
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
maybe we can ask @matthiasnoback about this since he wrote the security documentation |
I think you are checking for isGranted when not in a page under the firewall, am I correct? Then, it indeed do not work and it's also wanted to fail in that case. The listener is only executed when in the firewall, so that can't cause the error afaics. |
In my case, I was sticking to using it as authentication provider for a firewall. So yes the page where the errors happened was actually covered by a firewall. Only thing for this firewall anonymous users were disabled. I guess you'll need more details. Now my code diverged a little bit, if that is needed tomorrow I'll try to post some code snippets. |
Yeah, that will be more than helpfull (you can also push it to github or email me a zip if that's easier for you) |
Hi, Sorry I took some time, as I could not post my original code, I've made a fresh Symfony-StandardEdition test case: Just clone the repo, |
So now I'm pretty sure we should add a not to the cookbook entry, something like this:
|
…warning for when forbidding anonymous users (cordoval) This PR was merged into the 2.3 branch. Discussion ---------- [Cookbook][Custom Authentication Provider] add a note of warning for when forbidding anonymous users | Q | A | | --- | --- | | Doc fix? | yes | | New docs? | no | | Applies to | 2.3+ | | Fixed tickets | #3212 | | License | CC-ASA 3.0 Unported | Sent using [Gush](https://github.com/cordoval/gush) Commits ------- 244d756 add note when forbidding access to anonymous users on custom authentication provider
Hi,
I've just followed this cookbook entry.
However I'm encountering an issue when pretty much exactly following it: an
AuthenticationCredentialsNotFoundException
is raised.In my understanding the issue is that we should be doing something, returning prematurely in the listener is relevant only if another firewall is enabled, otherwise we end up having a 500 error.
This is not the case of the tutorial (the firewall is set for a very precise URL pattern): I guess we should be returning a 403 error, isn't it? And eventually adding a note to explain it.
I'm ok about submitting a PR if we agree upon the fix.
The text was updated successfully, but these errors were encountered: