From f8e201fc03fb2e0823038f905fc278d1a3e0d520 Mon Sep 17 00:00:00 2001 From: Daniel Werner Date: Sat, 3 Dec 2016 10:38:20 +0100 Subject: [PATCH 1/5] Update guard_authentication.rst --- security/guard_authentication.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/security/guard_authentication.rst b/security/guard_authentication.rst index 65ae5fb61a2..c88916bc094 100644 --- a/security/guard_authentication.rst +++ b/security/guard_authentication.rst @@ -412,11 +412,18 @@ Each authenticator needs the following methods: :class:`Symfony\\Component\\HttpFoundation\\Response` object that helps the user authenticate (e.g. a 401 response that says "token is missing!"). -**supportsRememberMe** +**supportsRememberMe()** If you want to support "remember me" functionality, return true from this method. You will still need to active ``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. + +**createAuthenticatedToken(UserInterface $user, string $providerKey)** + If you are implementing the :class:`Symfony\\Component\\Security\\Guard\\GuardAuthenticatorInterface` + Method instead of extending the :class:`Symfony\\Component\\Security\\Guard\\AbstractGuardAuthenticator`, + you have to implement this method. This method will be called + after a successful authentication to create and return the token + for the user, which was supplied as the first argument. .. _guard-customize-error: @@ -552,7 +559,7 @@ Frequently Asked Questions ), )); -**Can I use this with ``form_login``?** +**Can I use this with form_login?** Yes! ``form_login`` is *one* way to authenticate a user, so you could use it *and* then add one or more authenticators. Using a guard authenticator doesn't collide with other ways to authenticate. From 33c0d35a6c93a20456ed1df5ae8d291e653774d8 Mon Sep 17 00:00:00 2001 From: Daniel Werner Date: Sat, 3 Dec 2016 12:54:21 +0100 Subject: [PATCH 2/5] Accepted suggestions in the guard documentation --- security/guard_authentication.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/guard_authentication.rst b/security/guard_authentication.rst index c88916bc094..17280c27bf3 100644 --- a/security/guard_authentication.rst +++ b/security/guard_authentication.rst @@ -420,10 +420,10 @@ Each authenticator needs the following methods: **createAuthenticatedToken(UserInterface $user, string $providerKey)** If you are implementing the :class:`Symfony\\Component\\Security\\Guard\\GuardAuthenticatorInterface` - Method instead of extending the :class:`Symfony\\Component\\Security\\Guard\\AbstractGuardAuthenticator`, + instead of extending the :class:`Symfony\\Component\\Security\\Guard\\AbstractGuardAuthenticator`, you have to implement this method. This method will be called after a successful authentication to create and return the token - for the user, which was supplied as the first argument. + for the user, who was supplied as the first argument. .. _guard-customize-error: From b2f20f4ead9f653a22bd8655a6eabc71326641aa Mon Sep 17 00:00:00 2001 From: Daniel Werner Date: Sat, 3 Dec 2016 13:08:05 +0100 Subject: [PATCH 3/5] Accepted suggestions in the guard documentation --- security/guard_authentication.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/guard_authentication.rst b/security/guard_authentication.rst index 17280c27bf3..08f34273460 100644 --- a/security/guard_authentication.rst +++ b/security/guard_authentication.rst @@ -420,8 +420,8 @@ Each authenticator needs the following methods: **createAuthenticatedToken(UserInterface $user, string $providerKey)** If you are implementing the :class:`Symfony\\Component\\Security\\Guard\\GuardAuthenticatorInterface` - instead of extending the :class:`Symfony\\Component\\Security\\Guard\\AbstractGuardAuthenticator`, - you have to implement this method. This method will be called + class instead of extending the :class:`Symfony\\Component\\Security\\Guard\\AbstractGuardAuthenticator` + class, you have to implement this method. This method will be called after a successful authentication to create and return the token for the user, who was supplied as the first argument. From cb3abf3f75f8a48266f60c9ff9390474ba138d93 Mon Sep 17 00:00:00 2001 From: Daniel Werner Date: Sat, 3 Dec 2016 13:13:32 +0100 Subject: [PATCH 4/5] Accepted suggestions in the guard documentation --- security/guard_authentication.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/guard_authentication.rst b/security/guard_authentication.rst index 08f34273460..3cb248a1211 100644 --- a/security/guard_authentication.rst +++ b/security/guard_authentication.rst @@ -420,7 +420,7 @@ Each authenticator needs the following methods: **createAuthenticatedToken(UserInterface $user, string $providerKey)** If you are implementing the :class:`Symfony\\Component\\Security\\Guard\\GuardAuthenticatorInterface` - class instead of extending the :class:`Symfony\\Component\\Security\\Guard\\AbstractGuardAuthenticator` + instead of extending the :class:`Symfony\\Component\\Security\\Guard\\AbstractGuardAuthenticator` class, you have to implement this method. This method will be called after a successful authentication to create and return the token for the user, who was supplied as the first argument. From d17b18027cce045cfd85f56eeb1bbff731c302db Mon Sep 17 00:00:00 2001 From: Daniel Werner Date: Tue, 13 Dec 2016 09:39:26 +0100 Subject: [PATCH 5/5] Accepted Suggestions --- security/guard_authentication.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/guard_authentication.rst b/security/guard_authentication.rst index 3cb248a1211..b0baccf6a53 100644 --- a/security/guard_authentication.rst +++ b/security/guard_authentication.rst @@ -421,7 +421,7 @@ Each authenticator needs the following methods: **createAuthenticatedToken(UserInterface $user, string $providerKey)** If you are implementing the :class:`Symfony\\Component\\Security\\Guard\\GuardAuthenticatorInterface` instead of extending the :class:`Symfony\\Component\\Security\\Guard\\AbstractGuardAuthenticator` - class, you have to implement this method. This method will be called + class, you have to implement this method. It will be called after a successful authentication to create and return the token for the user, who was supplied as the first argument.