-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Skip user checks if not implementing UserInterface #27044
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
chalasr
commented
Apr 25, 2018
Q | A |
---|---|
Branch? | 2.7 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #26871 |
License | MIT |
Doc PR | n/a |
@@ -44,6 +45,10 @@ public function authenticate(TokenInterface $token) | |||
throw new AuthenticationException('Simple authenticator failed to return an authenticated token.'); | |||
} | |||
|
|||
if ($authToken instanceof AnonymousToken) { |
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.
the right check would be !$user instanceof UserInterface
, to cover all cases where calling the user checker is not possible.
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.
done
758860f
to
fa20fe1
Compare
fa20fe1
to
384acf9
Compare
Thank you @chalasr. |
…ace (chalasr) This PR was merged into the 2.7 branch. Discussion ---------- [Security] Skip user checks if not implementing UserInterface | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26871 | License | MIT | Doc PR | n/a Commits ------- 384acf9 [Security] Skip user checks if not implementing UserInterface
It seems that the changes have not been merged correctly into the 2.8 branch (and higher). I can confirm that the error no longer occurs in version 2.7, however, it still does occur in the versions 2.8, 3.4 and 4.0. |
But tests pass, so there is a missing test case. |
I can see what happened, I'm on it |
Here you go: #27059 |
… (leofeyer) This PR was merged into the 2.8 branch. Discussion ---------- Make the simple auth provider the same as in Symfony 2.7 | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27044 | License | MIT This PR adds the `SimpleAuthenticationProvider` changes made in Symfony 2.7 to Symfony 2.8. See #27044 (comment) Commits ------- 9afad9d Make the simple auth provider the same as in Symfony 2.7.