-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] SimpleAuthenticationProvider is broken #26775
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
A few questions:
|
I don't think it is necessary to set up a test case. Just compare the phpDocs of the two interfaces: TokenInterface::getUser() /**
* Returns a user representation.
*
* @return mixed Can be a UserInterface instance, an object implementing a __toString method,
* or the username as a regular string
*
* @see AbstractToken::setUser()
*/
public function getUser(); UserCheckerInterface::checkPreAuth() /**
* Checks the user account before authentication.
*
* @throws AccountStatusException
*/
public function checkPreAuth(UserInterface $user); You cannot pass the |
Would it make sense to run |
I propose to load the user in this case, see #26788. |
…needed (chalasr) This PR was merged into the 2.8 branch. Discussion ---------- [Security] Load the user before pre/post auth checks when needed | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | n/a | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26775 | License | MIT | Doc PR | n/a Commits ------- c318306 [Security] Load the user before pre/post auth checks when needed
Hi, I have same issue. |
Hey, the patch has been merged but not released yet, it will be fixed in 3.4.8 |
3.4.8 has been released |
Unfortunately, the new implementation is broken as well, see my comment in #26788 (comment) |
@chalasr Was this issue fixed in 3.4 only? Has it been backported to 2.8? |
Dunno why started to receive this issue.
So the issue persists somewhere
|
This is because some package was updated with security package where was added new method
|
@BonBonSlick Does it mean your issue has been solved? |
The changes from #26370 break the simple authentication provider.
symfony/src/Symfony/Component/Security/Core/Authentication/Provider/SimpleAuthenticationProvider.php
Lines 47 to 48 in 341682e
$authToken->getUser()
returns a "UserInterface instance, an object implementing a __toString method, or the username as a regular string", however theUserChecker::checkPreAuth()
method allows a UserInterface instance only. An anonymous token results in the following exception:@i3or1s /cc
The text was updated successfully, but these errors were encountered: