Skip to content

[Security] Deprecated AuthenticationTrustResolver #35860

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

Closed

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Feb 25, 2020

Q A
Branch? master
Bug fix? no
New feature? no
Deprecations? yes
Tickets n/a
License MIT
Doc PR tbd

After #26981 , the trust resolver only contains 3 methods doing an instanceof check. I think it's better to deprecate this class and its usages. A user can use the attributes of #31189 or check instance of the token instead. Customizing the token FQCN used for RememberMe/Anonymous is very discouraged and if you do, I would highly recommend extending from them.

This does however result in quite some changes in the constructor arguments of some listeners. This poses the question whether or not it's worth it and if we really need to keep BC here (tbh, I think all firewall listeners can be considered internals, but we never marked them as such 😢 ).

@fabpot
Copy link
Member

fabpot commented Feb 25, 2020

We've gradually marked classes and methods as being internal and/or final. I think we've never really done that for the Security component. But it's never too late.

@wouterj
Copy link
Member Author

wouterj commented Feb 25, 2020

@fabpot if we make things internal in 5.1, can we make BC breaking changes in 5.3/5.4? The BC promise says "Classes that received the @final annotation after their first release are considered final in their next major version.", but it doesn't mention if the same applies to @internal. I'm guessing it does, so that means we have to postpone the cleanup till 6.1/7.0

@linaori
Copy link
Contributor

linaori commented Feb 25, 2020

Currently there's a limited way of implemented a custom Authentication level. Before this implementation is deprecated, can we provide a way to add your own? For reference, this package is using a custom trust resolver to get into a "need 2 factor code" authentication level: https://github.com/scheb/two-factor-bundle/blob/728b743c03560f7f0aff53599f33e7e2a99f6868/Security/Authentication/AuthenticationTrustResolver.php

When removing this class in the future, there's no (easy) way to not be fully authenticated with a "custom level".

@wouterj
Copy link
Member Author

wouterj commented Feb 25, 2020

Oh, that's interesting.

What I would love to do is introducing the concept of "level of assurance" as described in #28868 (comment) . This would fully replace the IS_AUTHENTICATED_* attributes and provide a flexible alternative for build-in 2FA, sudo mode, etc.

Yet, I don't know about anyone working on that and I for sure don't have time to work on it atm. So I think the best option would be to postpone this PR and deprecated the AuthenticationTrustResolver if (when?) we implement level of assurance.

@fabpot
Copy link
Member

fabpot commented Sep 7, 2020

@wouterj What's your thoughts about this one? Shall we close?

@wouterj
Copy link
Member Author

wouterj commented Sep 7, 2020

Yes, let's close. At least at this moment, we can't remove the class (due to MFA usages). Sorry for not checking my stale PRs every so often!

@wouterj wouterj closed this Sep 7, 2020
@wouterj wouterj deleted the security/deprecate-trust-resolver branch September 7, 2020 07:42
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.2 Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants