Skip to content

Commit

Permalink
Clarification on stateful firewall, fixes #175
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Rhodes authored and scheb committed Feb 23, 2023
1 parent 6db73c6 commit 701cdc4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ but provides API endpoints instead.
Prerequisites
-------------

To make two-factor authentication work in an API, your **API has to be stateful** (``stateless: false`` in the firewall
configuration or not configured at all, as it's stateful per default). That means the API is starting a session which is
passed by the client on every call. The session is necessary for two-factor authentication to store the state of the
login - if the user has already completed two-factor authentication or not.
To make two-factor authentication work in an API, the firewall that you're doing your authentication on
**has to be stateful** (``stateless: false`` in the firewall configuration or not configured at all, as it's stateful
per default). That means the API is starting a session which is passed by the client on every call. The session is
necessary for two-factor authentication to store the state of the login - if the user has already completed two-factor
authentication or not.

If you use a custom authenticator (you may have followed Symfony's guide
`Custom Authentication System with Guard (API Token Example) <https://symfony.com/doc/current/security/guard_authentication.html>`_),
Expand Down

0 comments on commit 701cdc4

Please sign in to comment.