Skip to content

Commit 0a9b9a5

Browse files
committed
[Security] Deprecate the old authentication systems
1 parent 10ced7a commit 0a9b9a5

33 files changed

+137
-4
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,16 @@ public function getConfigTreeBuilder()
8383
return $v;
8484
})
8585
->end()
86+
->beforeNormalization()
87+
->ifTrue(function ($v) {
88+
return $v['enable_authenticator_manager'] ?? false;
89+
})
90+
->then(function ($v) {
91+
trigger_deprecation('symfony/security-bundle', '5.3', 'Not setting the "security.enable_authenticator_manager" config option to true is deprecated.');
92+
93+
return $v;
94+
})
95+
->end()
8696
->children()
8797
->scalarNode('access_denied_url')->defaultNull()->example('/foo/error403')->end()
8898
->enumNode('session_fixation_strategy')

src/Symfony/Component/Security/Core/Authentication/AuthenticationManagerInterface.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@
1313

1414
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1515
use Symfony\Component\Security\Core\Exception\AuthenticationException;
16+
use Symfony\Component\Security\Http\Firewall\X509AuthenticationListener;
17+
18+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" interface is deprecated, use the new authenticator system instead.', AuthenticationManagerInterface::class);
1619

1720
/**
1821
* AuthenticationManagerInterface is the interface for authentication managers,
1922
* which process Token authentication.
2023
*
2124
* @author Fabien Potencier <fabien@symfony.com>
25+
*
26+
* @deprecated since Symfony 5.3, use the new authenticator system instead
2227
*/
2328
interface AuthenticationManagerInterface
2429
{

src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
use Symfony\Component\Security\Core\User\UserInterface;
2525
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2626

27+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', AuthenticationProviderManager::class);
28+
2729
// Help opcache.preload discover always-needed symbols
2830
class_exists(AuthenticationEvents::class);
2931
class_exists(AuthenticationFailureEvent::class);
@@ -35,6 +37,8 @@ class_exists(AuthenticationSuccessEvent::class);
3537
*
3638
* @author Fabien Potencier <fabien@symfony.com>
3739
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
40+
*
41+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3842
*/
3943
class AuthenticationProviderManager implements AuthenticationManagerInterface
4044
{

src/Symfony/Component/Security/Core/Authentication/Provider/AnonymousAuthenticationProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@
1616
use Symfony\Component\Security\Core\Exception\AuthenticationException;
1717
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
1818

19+
trigger_deprecation('symfony/security-core', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', AnonymousAuthenticationProvider::class);
20+
1921
/**
2022
* AnonymousAuthenticationProvider validates AnonymousToken instances.
2123
*
2224
* @author Fabien Potencier <fabien@symfony.com>
25+
*
26+
* @deprecated since Symfony 5.3, use the new authenticator system instead
2327
*/
2428
class AnonymousAuthenticationProvider implements AuthenticationProviderInterface
2529
{

src/Symfony/Component/Security/Core/Authentication/Provider/AuthenticationProviderInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@
1414
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
1515
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1616

17+
trigger_deprecation('symfony/security-core', '5.3', 'The "%s" interface is deprecated, use the new authenticator system instead.', AuthenticationProviderInterface::class);
18+
1719
/**
1820
* AuthenticationProviderInterface is the interface for all authentication
1921
* providers.
2022
*
2123
* Concrete implementations processes specific Token instances.
2224
*
2325
* @author Fabien Potencier <fabien@symfony.com>
26+
*
27+
* @deprecated since Symfony 5.3, use the new authenticator system instead
2428
*/
2529
interface AuthenticationProviderInterface extends AuthenticationManagerInterface
2630
{

src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@
2424
use Symfony\Component\Security\Core\User\UserInterface;
2525
use Symfony\Component\Security\Core\User\UserProviderInterface;
2626

27+
trigger_deprecation('symfony/security-core', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', DaoAuthenticationProvider::class);
28+
2729
/**
2830
* DaoAuthenticationProvider uses a UserProviderInterface to retrieve the user
2931
* for a UsernamePasswordToken.
3032
*
3133
* @author Fabien Potencier <fabien@symfony.com>
34+
*
35+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3236
*/
3337
class DaoAuthenticationProvider extends UserAuthenticationProvider
3438
{

src/Symfony/Component/Security/Core/Authentication/Provider/LdapBindAuthenticationProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@
2121
use Symfony\Component\Security\Core\User\UserInterface;
2222
use Symfony\Component\Security\Core\User\UserProviderInterface;
2323

24+
trigger_deprecation('symfony/security-core', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', LdapBindAuthenticationProvider::class);
25+
2426
/**
2527
* LdapBindAuthenticationProvider authenticates a user against an LDAP server.
2628
*
2729
* The only way to check user credentials is to try to connect the user with its
2830
* credentials to the ldap.
2931
*
3032
* @author Charles Sarrazin <charles@sarraz.in>
33+
*
34+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3135
*/
3236
class LdapBindAuthenticationProvider extends UserAuthenticationProvider
3337
{

src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
use Symfony\Component\Security\Core\User\UserCheckerInterface;
1919
use Symfony\Component\Security\Core\User\UserProviderInterface;
2020

21+
trigger_deprecation('symfony/security-core', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', PreAuthenticatedAuthenticationProvider::class);
22+
2123
/**
2224
* Processes a pre-authenticated authentication request.
2325
*
@@ -27,6 +29,8 @@
2729
* UserNotFoundException, for example.
2830
*
2931
* @author Fabien Potencier <fabien@symfony.com>
32+
*
33+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3034
*/
3135
class PreAuthenticatedAuthenticationProvider implements AuthenticationProviderInterface
3236
{

src/Symfony/Component/Security/Core/Authentication/Provider/RememberMeAuthenticationProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
use Symfony\Component\Security\Core\User\UserCheckerInterface;
2020
use Symfony\Component\Security\Core\User\UserInterface;
2121

22+
trigger_deprecation('symfony/security-core', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', RememberMeAuthenticationProvider::class);
23+
24+
/**
25+
* @deprecated since Symfony 5.3, use the new authenticator system instead
26+
*/
2227
class RememberMeAuthenticationProvider implements AuthenticationProviderInterface
2328
{
2429
private $userChecker;

src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@
2121
use Symfony\Component\Security\Core\User\UserCheckerInterface;
2222
use Symfony\Component\Security\Core\User\UserInterface;
2323

24+
trigger_deprecation('symfony/security-core', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', UserAuthenticationProvider::class);
25+
2426
/**
2527
* UserProviderInterface retrieves users for UsernamePasswordToken tokens.
2628
*
2729
* @author Fabien Potencier <fabien@symfony.com>
30+
*
31+
* @deprecated since Symfony 5.3, use the new authenticator system instead
2832
*/
2933
abstract class UserAuthenticationProvider implements AuthenticationProviderInterface
3034
{

0 commit comments

Comments
 (0)