-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Require entry_point to be configured with multiple authenticators #36575
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
Conversation
src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
Outdated
Show resolved
Hide resolved
8c5fbdd
to
6179d5d
Compare
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
Outdated
Show resolved
Hide resolved
6179d5d
to
7a63e6a
Compare
src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
Outdated
Show resolved
Hide resolved
98b949b
to
cc876a2
Compare
...ny/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginFactory.php
Outdated
Show resolved
Hide resolved
7169af4
to
83c9c3a
Compare
Both test failures appear to be unrelated |
83c9c3a
to
ee5654c
Compare
ee5654c
to
7e86169
Compare
Thank you @wouterj. |
@wouterj I haven't had time to investigate further, but this PR breaks auth on my app. I get "Full authentication is required to access this resource." when trying to authenticate. |
Oh, I think #36650 should fix it. Sorry, I finished this patch on my Windows PC to get it ready before the weekend. I'll try to add some tests for the DI stuff in SecurityBundle in some weeks. |
…#36575) (wouterj) This PR was merged into the 5.1-dev branch. Discussion ---------- [Security] Fix bug introduced in entry_point configuration (#36575) | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- 6978471 Fixed #36575
@@ -65,7 +67,7 @@ public function create(ContainerBuilder $container, string $id, array $config, s | |||
} | |||
|
|||
// create entry point if applicable (optional) | |||
$entryPointId = $this->createEntryPoint($container, $id, $config, $defaultEntryPointId); | |||
$entryPointId = $this->createDefaultEntryPoint($container, $id, $config, $defaultEntryPointId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the BC break that makes my code fail now. AbstractFactory
is what we use in Connect Bundle: https://github.com/symfonycorp/connect-bundle/blob/master/src/DependencyInjection/Security/Factory/ConnectFactory.php
/cc @wouterj
So, even if I can probably fix it in Connect, I fear that we won't be alone by this problem. Anyone not using Guard is probably extending AbstractFactory
. That means that we cannot mark AbstractFactory
as @internal
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for debugging!
That also means we have to find another method name for the EntryPointInterface
interface, to not conflict with the abstract method in this class. I'll do a PR later this evening. See #36661
…d multiple guard entry points (wouterj) This PR was squashed before being merged into the 5.1-dev branch. Discussion ---------- [SecurityBundle] Fixed entry point service ID resolving and multiple guard entry points | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | n/a @fabpot I am not able to reproduce [the error you reported](#36575 (comment)) in any of my demo applications or in the tests introduced in this PR. The error indicates that no entry point is configured in your application, can you maybe try out this patch (given it now makes a hard error when more than one guard is used)? If it still doesn't work, can you maybe share your firewall configuration? --- _build failures are unrelated_ Commits ------- c756593 Do not make AbstractFactory internal and revert method rename 6870a18 Fixed entry point resolving and guard entry point configuration
…d multiple guard entry points (wouterj) This PR was squashed before being merged into the 5.1-dev branch. Discussion ---------- [SecurityBundle] Fixed entry point service ID resolving and multiple guard entry points | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | n/a @fabpot I am not able to reproduce [the error you reported](symfony/symfony#36575 (comment)) in any of my demo applications or in the tests introduced in this PR. The error indicates that no entry point is configured in your application, can you maybe try out this patch (given it now makes a hard error when more than one guard is used)? If it still doesn't work, can you maybe share your firewall configuration? --- _build failures are unrelated_ Commits ------- c75659350e Do not make AbstractFactory internal and revert method rename 6870a18803 Fixed entry point resolving and guard entry point configuration
See @weaverryan's comment at #33558 (comment):
Before (one authenticator)
After
Same as before
Before (multiple authenticators)
After
Before (custom entry point service)
After
Same as before