-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Security] Add a Not_Full_Fledged_handler in ExceptionListener from security login #57661
New issu 10000 e
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
base: 7.3
Are you sure you want to change the base?
Conversation
64b0bdd
to
7e36014
Compare
7e36014
to
a7ace88
Compare
bdb9552
to
f64b805
Compare
src/Symfony/Component/Security/Http/Authorization/SameAsNotFullFledgedHandle.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php
Outdated
Show resolved
Hide resolved
a5ff172
to
05ca8dd
Compare
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.
I'm not convinced by this PR. To me, it does not actually solve the issue it claims to solve (it solves only a subset of cases, bringing an invalid behavior for the other cases).
So for now, it gets a -1 vote from me.
src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/Authorization/NotFullFledgedHandlerInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/Authorization/NotFullFledgedHandlerInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/Authorization/SameAsNotFullFledgedHandler.php
Outdated
Show resolved
Hide resolved
} | ||
8000 |
|
|
foreach($accessDeniedException->getAttributes() as $attribute) { | ||
if(in_array($attribute, [AuthenticatedVoter::IS_AUTHENTICATED_FULLY])) { |
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 not enough to identify all cases where an access denied exception might depend on the trust level of a token (see my comment on the issue).
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.
it totally a case whitch can be set in a custom handler.
SameAsNotFullFledgedHandler is here to anwser to many person, when PR will be merged (yes I beleive on it) if many persons have the same idea it can be possible to propose another PR for add core handlers
src/Symfony/Component/Security/Http/Authorization/NotFullFledgedHandlerInterface.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php
Show resolved
Hide resolved
I don't undestand why you say it does not actually solve the issue. the problem is to obtain a control of AccessDenied Exception when RememberMe login is active, this PR allow a custom handler to choose:
I don't see whitch case is not cover ? |
@eltharin have you read my comment on the issue ? |
I do but I don't understand where you find a problem, |
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
Outdated
Show resolved
Hide resolved
60cb97e
to
2c019ce
Compare
818ff65
to
91dc0c2
Compare
src/Symfony/Component/Security/Http/Authorization/NotFullFledgedHandlerInterface.php
Outdated
Show resolved
Hide resolved
0815414
to
3e1d1ea
Compare
3e1d1ea
to
a96aecb
Compare
What can we do to advance this PR ? |
if not authenticated at all use callback instead boolean
add r to handleR
…Extension.php Co-authored-by: Oskar Stark <oskarstark@googlemail.com>
a96aecb
to
0fb0b24
Compare
My proposal for behaviour for acces Denied When User is logged with a remeberme token
Without set anything, the behaviour is the same as actually.
In the Firewall config adding a not_full_fledged_handler waiting a service handler or a predefined value :
"original""redirect" for the same behavior than actual replaced bySymfony\Component\Security\Http\Authorization\NotFullFledgedRedirectToStartAuthenticationHandler
"same""equal" for if a user is logged but not not full fledged (and the attribute is not IS_AUTHENTICATED_FULLY) he has the same acces than if he was full logged. this value is replaced bySymfony\Component\Security\Http\Authorization\NotFullFledgedEqualNormalLoginHandler
Symfony\Component\Security\Http\Authorization\NotFullFledgedHandlerInterface
with one method "handle"this method can return a reponse to change original Exception Response or null for continue to throw the original access denied exception.