Skip to content

Commit b7471d5

Browse files
committed
[Security] Deprecate the old authentication mechanisms
1 parent 1be2a05 commit b7471d5

18 files changed

+60
-2
lines changed

Firewall/AbstractAuthenticationListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
3232
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
3333

34+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', AbstractAuthenticationListener::class);
35+
3436
/**
3537
* The AbstractAuthenticationListener is the preferred base class for all
3638
* browser-/HTTP-based authentication requests.
@@ -47,6 +49,8 @@
4749
*
4850
* @author Fabien Potencier <fabien@symfony.com>
4951
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
52+
*
53+
* @deprecated since Symfony 5.3, use the new authenticator system instead
5054
*/
5155
abstract class AbstractAuthenticationListener extends AbstractListener
5256
{

Firewall/AbstractPreAuthenticatedListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
2626
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2727

28+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', AbstractPreAuthenticatedListener::class);
29+
2830
/**
2931
* AbstractPreAuthenticatedListener is the base class for all listener that
3032
* authenticates users based on a pre-authenticated request (like a certificate
@@ -33,6 +35,8 @@
3335
* @author Fabien Potencier <fabien@symfony.com>
3436
*
3537
* @internal
38+
*
39+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3640
*/
3741
abstract class AbstractPreAuthenticatedListener extends AbstractListener
3842
{

Firewall/AnonymousAuthenticationListener.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
2020
use Symfony\Component\Security\Core\Exception\AuthenticationException;
2121

22+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', AnonymousAuthenticationListener::class);
23+
2224
// Help opcache.preload discover always-needed symbols
2325
class_exists(AnonymousToken::class);
2426

@@ -28,7 +30,7 @@ class_exists(AnonymousToken::class);
2830
*
2931
* @author Fabien Potencier <fabien@symfony.com>
3032
*
31-
* @final
33+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3234
*/
3335
class AnonymousAuthenticationListener extends AbstractListener
3436
{

Firewall/BasicAuthenticationListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@
2222
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
2323
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
2424

25+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', AnonymousAuthenticationListener::class);
26+
2527
/**
2628
* BasicAuthenticationListener implements Basic HTTP authentication.
2729
*
2830
* @author Fabien Potencier <fabien@symfony.com>
2931
*
3032
* @final
33+
*
34+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3135
*/
3236
class BasicAuthenticationListener extends AbstractListener
3337
{

Firewall/RememberMeListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,16 @@
2424
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
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.', RememberMeListener::class);
28+
2729
/**
2830
* RememberMeListener implements authentication capabilities via a cookie.
2931
*
3032
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
3133
*
3234
* @final
35+
*
36+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3337
*/
3438
class RememberMeListener extends AbstractListener
3539
{

Firewall/RemoteUserAuthenticationListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@
1818
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
1919
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2020

21+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', RemoteUserAuthenticationListener::class);
22+
2123
/**
2224
* REMOTE_USER authentication listener.
2325
*
2426
* @author Fabien Potencier <fabien@symfony.com>
2527
* @author Maxime Douailin <maxime.douailin@gmail.com>
28+
*
29+
* @deprecated since Symfony 5.3, use the new authenticator system instead
2630
*/
2731
class RemoteUserAuthenticationListener extends AbstractPreAuthenticatedListener
2832
{

Firewall/UsernamePasswordFormAuthenticationListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@
2929
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface;
3030
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
3131

32+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', UsernamePasswordFormAuthenticationListener::class);
33+
3234
/**
3335
* UsernamePasswordFormAuthenticationListener is the default implementation of
3436
* an authentication via a simple form composed of a username and a password.
3537
*
3638
* @author Fabien Potencier <fabien@symfony.com>
39+
*
40+
* @deprecated since Symfony 5.3, use the new authenticator system instead
3741
*/
3842
class UsernamePasswordFormAuthenticationListener extends AbstractAuthenticationListener
3943
{

Firewall/UsernamePasswordJsonAuthenticationListener.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@
3636
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
3737
use Symfony\Contracts\Translation\TranslatorInterface;
3838

39+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', UsernamePasswordJsonAuthenticationListener::class);
40+
3941
/**
4042
* UsernamePasswordJsonAuthenticationListener is a stateless implementation of
4143
* an authentication via a JSON document composed of a username and a password.
4244
*
4345
* @author Kévin Dunglas <dunglas@gmail.com>
4446
*
45-
* @final
47+
* @deprecated since Symfony 5.3, use the new authenticator system instead
4648
*/
4749
class UsernamePasswordJsonAuthenticationListener extends AbstractListener
4850
{

Firewall/X509AuthenticationListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@
1818
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
1919
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2020

21+
trigger_deprecation('symfony/security-http', '5.3', 'The "%s" class is deprecated, use the new authenticator system instead.', X509AuthenticationListener::class);
22+
2123
/**
2224
* X509 authentication listener.
2325
*
2426
* @author Fabien Potencier <fabien@symfony.com>
27+
*
28+
* @deprecated since Symfony 5.3, use the new authenticator system instead
2529
*/
2630
class X509AuthenticationListener extends AbstractPreAuthenticatedListener
2731
{

Tests/Firewall/AbstractPreAuthenticatedListenerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
use Symfony\Component\Security\Core\Exception\AuthenticationException;
2323
use Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener;
2424

25+
/**
26+
* @group legacy
27+
*/
2528
class AbstractPreAuthenticatedListenerTest extends TestCase
2629
{
2730
public function testHandleWithValidValues()

0 commit comments

Comments
 (0)