Skip to content

Commit df3dd4a

Browse files
committed
Merge branch '3.4' into 4.1
* 3.4: Fixing bad logic, caused by merge originally Mentioned user_checkers in the main security config reference If multiple guard authenticators have different providers, link to the details on chaining providers together.
2 parents d697d44 + db48479 commit df3dd4a

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

reference/configuration/security.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,15 @@ multiple firewalls, the "context" could actually be shared:
490490
ignored and you won't be able to authenticate on multiple firewalls at the
491491
same time.
492492

493+
User Checkers
494+
-------------
495+
496+
During the authentication of a user, additional checks might be required to
497+
verify if the identified user is allowed to log in. Each firewall can include
498+
a ``user_checker`` option to define the service used to perform those checks.
499+
500+
Learn more about user checkers in :doc:`/security/user_checkers`.
501+
493502
.. _`PBKDF2`: https://en.wikipedia.org/wiki/PBKDF2
494503
.. _`ircmaxell/password-compat`: https://packagist.org/packages/ircmaxell/password-compat
495504
.. _`libsodium`: https://pecl.php.net/package/libsodium

security/guard_authentication.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,8 @@ can ignore this. Here is an example of good and bad behavior::
438438

439439
public function supports(Request $request)
440440
{
441-
// GOOD behavior: only authenticate on a specific route
442-
if ($request->attributes->get('_route') !== 'login_route' || !$request->isMethod('POST')) {
443-
return true;
444-
}
441+
// GOOD behavior: only authenticate (i.e. return true) on a specific route
442+
return 'login_route' === $request->attributes->get('_route') && $request->isMethod('POST');
445443

446444
// e.g. your login system authenticates by the user's IP address
447445
// BAD behavior: So, you decide to *always* return true so that

security/multiple_guard_authenticators.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ This is how your security configuration can look in action:
7878
),
7979
));
8080
81+
If your authenticators need separate providers, you will need to create a
82+
:doc:`chain of user providers </security/multiple_user_providers>`.
83+
8184
There is one limitation with this approach - you have to use exactly one entry point.
8285

8386
Multiple Authenticators with Separate Entry Points

0 commit comments

Comments
 (0)