1212use Symfony \Component \Security \Http \EntryPoint \AuthenticationEntryPointInterface ;
1313
1414/**
15- * The interface for all "guard" authenticators
15+ * The interface for all "guard" authenticators.
1616 *
1717 * The methods on this interface are called throughout the guard authentication
1818 * process to give you the power to control most parts of the process from
@@ -41,48 +41,54 @@ interface GuardAuthenticatorInterface extends AuthenticationEntryPointInterface
4141 * return array('api_key' => $request->headers->get('X-API-TOKEN'));
4242 *
4343 * @param Request $request
44+ *
4445 * @return mixed|null
4546 */
4647 public function getCredentialsFromRequest (Request $ request );
4748
4849 /**
4950 * Return a UserInterface object based on the credentials OR throw
50- * an AuthenticationException
51+ * an AuthenticationException.
5152 *
5253 * The *credentials* are the return value from getCredentialsFromRequest()
5354 *
54- * @param mixed $credentials
55+ * @param mixed $credentials
5556 * @param UserProviderInterface $userProvider
57+ *
5658 * @throws AuthenticationException
59+ *
5760 * @return UserInterface
5861 */
5962 public function authenticate ($ credentials , UserProviderInterface $ userProvider );
6063
6164 /**
62- * Create an authenticated token for the given user
65+ * Create an authenticated token for the given user.
6366 *
6467 * If you don't care about which token class is used or don't really
6568 * understand what a "token" is, you can skip this method by extending
6669 * the AbstractGuardAuthenticator class from your authenticator.
6770 *
6871 * @see AbstractGuardAuthenticator
72+ *
6973 * @param UserInterface $user
70- * @param string $providerKey The provider (i.e. firewall) key
74+ * @param string $providerKey The provider (i.e. firewall) key
75+ *
7176 * @return GuardTokenInterface
7277 */
7378 public function createAuthenticatedToken (UserInterface $ user , $ providerKey );
7479
7580 /**
76- * Called when authentication executed, but failed (e.g. wrong username password)
81+ * Called when authentication executed, but failed (e.g. wrong username password).
7782 *
7883 * This should return the Response sent back to the user, like a
7984 * RedirectResponse to the login page or a 403 response.
8085 *
8186 * If you return null, the request will continue, but the user will
8287 * not be authenticated. This is probably not what you want to do.
8388 *
84- * @param Request $request
89+ * @param Request $request
8590 * @param AuthenticationException $exception
91+ *
8692 * @return Response|null
8793 */
8894 public function onAuthenticationFailure (Request $ request , AuthenticationException $ exception );
@@ -96,9 +102,10 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
96102 * If you return null, the current request will continue, and the user
97103 * will be authenticated. This makes sense, for example, with an API.
98104 *
99- * @param Request $request
105+ * @param Request $request
100106 * @param TokenInterface $token
101- * @param string $providerKey The provider (i.e. firewall) key
107+ * @param string $providerKey The provider (i.e. firewall) key
108+ *
102109 * @return Response|null
103110 */
104111 public function onAuthenticationSuccess (Request $ request , TokenInterface $ token , $ providerKey );
0 commit comments