File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
src/Symfony/Component/Security/Http/EntryPoint Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 16
16
use Symfony \Component \HttpFoundation \Response ;
17
17
18
18
/**
19
- * AuthenticationEntryPointInterface is the interface used to start the
20
- * authentication scheme .
19
+ * Implement this interface for any classes that will be called to " start"
20
+ * the authentication process (see method for more details) .
21
21
*
22
22
* @author Fabien Potencier <fabien@symfony.com>
23
23
*/
24
24
interface AuthenticationEntryPointInterface
25
25
{
26
26
/**
27
- * Starts the authentication scheme.
27
+ * Returns a response that directs the user to authenticate
28
+ *
29
+ * This is called when an anonymous request accesses a resource that
30
+ * requires authentication. The job of this method is to return some
31
+ * response that "helps" the user start into the authentication process.
32
+ *
33
+ * Examples:
34
+ * A) For a form login, you might redirect to the login page
35
+ * return new Response('/login');
36
+ * B) For an API token authentication system, you return a 401 response
37
+ * return new Response('Auth header required', 401);
28
38
*
29
39
* @param Request $request The request that resulted in an AuthenticationException
30
40
* @param AuthenticationException $authException The exception that started the authentication process
You can’t perform that action at this time.
0 commit comments