Skip to content

Update guard_authentication.rst #12856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions security/guard_authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Finally, configure your ``firewalls`` key in ``security.yaml`` to use this authe
'logout' => true,
'guard' => [
'authenticators' => [
TokenAuthenticator::class
TokenAuthenticator::class,
],
],
// ...
Expand Down Expand Up @@ -300,7 +300,7 @@ Each authenticator needs the following methods:
(or throw an :ref:`AuthenticationException <guard-customize-error>`),
authentication will fail.

**onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)**
**onAuthenticationSuccess(Request $request, TokenInterface $token, string $providerKey)**
This is called after successful authentication and your job is to either
return a :class:`Symfony\\Component\\HttpFoundation\\Response` object
that will be sent to the client or ``null`` to continue the request
Expand All @@ -321,7 +321,7 @@ Each authenticator needs the following methods:
the user authenticate (e.g. a 401 response that says "token is missing!").

**supportsRememberMe()**
If you want to support "remember me" functionality, return true from this method.
If you want to support "remember me" functionality, return ``true`` from this method.
You will still need to activate ``remember_me`` under your firewall for it to work.
Since this is a stateless API, you do not want to support "remember me"
functionality in this example.
Expand All @@ -330,7 +330,7 @@ Each authenticator needs the following methods:
If you are implementing the :class:`Symfony\\Component\\Security\\Guard\\AuthenticatorInterface`
instead of extending the :class:`Symfony\\Component\\Security\\Guard\\AbstractGuardAuthenticator`
class, you have to implement this method. It will be called
after a successful authentication to create and return the token
after a successful authentication to create and return the token (a class implementing :class:`Symfony\\Component\\Security\\Guard\\Token\\GuardTokenInterface`)
for the user, who was supplied as the first argument.

The picture below shows how Symfony calls Guard Authenticator methods:
Expand Down