Skip to content

Commit 2cd3f35

Browse files
committed
Add documentation for needsPreparation method
1 parent 93563d2 commit 2cd3f35

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

doc/providers/custom.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ authentication token, the user entity and other information.
3333
The method has to decide if the user should be asked for two-factor authentication from that provider. In that case
3434
return ``true``, otherwise ``false``.
3535

36+
needsPreparation
37+
~~~~~~~~~~~~~~~~
38+
39+
.. code-block:: php
40+
41+
public function needsPreparation(): bool;
42+
43+
The method determines if the provider needs to be prepared. If ``false`` is returned, the ``prepareAuthentication`` will
44+
not be called and the provider is considered "prepared" right from the start. This is valuable for authentication
45+
providers such as TOTP, which can then be used in a stateless firewall.
46+
3647
prepareAuthentication
3748
~~~~~~~~~~~~~~~~~~~~~
3849

0 commit comments

Comments
 (0)