Skip to content

Commit 330aa7f

Browse files
committed
Improving phpdoc on AuthenticationEntryPointInterface so people that implement this understand it
1 parent 4d275b4 commit 330aa7f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/Symfony/Component/Security/Http/EntryPoint/AuthenticationEntryPointInterface.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,25 @@
1616
use Symfony\Component\HttpFoundation\Response;
1717

1818
/**
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).
2121
*
2222
* @author Fabien Potencier <fabien@symfony.com>
2323
*/
2424
interface AuthenticationEntryPointInterface
2525
{
2626
/**
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);
2838
*
2939
* @param Request $request The request that resulted in an AuthenticationException
3040
* @param AuthenticationException $authException The exception that started the authentication process

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy