Skip to content

Commit bc22154

Browse files
committed
Configure authenticator priority lower than any official authenticator (#265)
1 parent bbfd7ad commit bc22154

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

UPGRADE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ Upgrading
33

44
Here's an overview if you have to do any work when upgrading.
55

6+
7.x to 8.x
7+
----------
8+
9+
Priority of the two-factor authenticator has changed from `0` to `-100`. Please make sure your authentication system
10+
is still working fine, especially when you're using custom (non-official) authenticators. You might need to adjust
11+
the priority of your custom authenticator.
12+
13+
614
6.x to 7.x
715
----------
816

src/bundle/DependencyInjection/Factory/Security/TwoFactorFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
class TwoFactorFactory implements FirewallListenerFactoryInterface, AuthenticatorFactoryInterface
2020
{
21+
public const AUTHENTICATOR_PRIORITY = -100;
2122
public const AUTHENTICATION_PROVIDER_KEY = 'two_factor';
2223

2324
public const DEFAULT_CHECK_PATH = '/2fa_check';
@@ -172,6 +173,7 @@ public function getKey(): string
172173

173174
public function getPriority(): int
174175
{
175-
return 0;
176+
// Lower than the lowest "official" authenticator HttpBasicFactory (-50)
177+
return self::AUTHENTICATOR_PRIORITY;
176178
}
177179
}

0 commit comments

Comments
 (0)