1 | <?php |
||
14 | class LegacyAuthenticator extends AbstractGuardAuthenticator |
||
15 | { |
||
16 | /** |
||
17 | * Called on every request. Return whatever credentials you want, |
||
18 | * or null to stop authentication. |
||
19 | * |
||
20 | * |
||
21 | * @return mixed|null |
||
22 | */ |
||
23 | public function getCredentials(Request $request) |
||
37 | |||
38 | /** |
||
39 | * Returns a UserInterface object based on the credentials. |
||
40 | * |
||
41 | * @param mixed $credentials |
||
42 | */ |
||
43 | public function getUser($credentials, UserProviderInterface $userProvider): ?LegacyUser |
||
51 | |||
52 | /** |
||
53 | * Returns true if the credentials are valid. |
||
54 | * |
||
55 | * @param mixed $credentials |
||
56 | * |
||
57 | * @return bool |
||
58 | */ |
||
59 | public function checkCredentials($credentials, UserInterface $user) |
||
67 | |||
68 | /** |
||
69 | * Called when the authentication is successful. |
||
70 | * |
||
71 | * @param string $providerKey |
||
72 | */ |
||
73 | public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey) |
||
78 | |||
79 | /** |
||
80 | * Called when the authentication fails. |
||
81 | */ |
||
82 | public function onAuthenticationFailure(Request $request, AuthenticationException $exception) |
||
86 | |||
87 | /** |
||
88 | * Called when authentication is needed, but it's not sent |
||
89 | * |
||
90 | * |
||
91 | * @return RedirectResponse |
||
92 | */ |
||
93 | public function start(Request $request, AuthenticationException $authException = null) |
||
100 | |||
101 | /** |
||
102 | * @return bool |
||
103 | */ |
||
104 | public function supportsRememberMe() |
||
108 | |||
109 | public function supports(Request $request): bool |
||
113 | } |
||
114 |