Upgraded drupal core with security updates
[yaffs-website] / web / core / lib / Drupal / Core / Authentication / AuthenticationProviderFilterInterface.php
1 <?php
2
3 namespace Drupal\Core\Authentication;
4
5 use Symfony\Component\HttpFoundation\Request;
6
7 /**
8  * Restrict authentication methods to a subset of the site.
9  *
10  * Some authentication methods should not be available throughout a whole site.
11  * For instance, there are good reasons to restrict insecure methods like HTTP
12  * basic authentication or a URL token authentication method to API-only
13  * routes.
14  */
15 interface AuthenticationProviderFilterInterface {
16
17   /**
18    * Checks whether the authentication method is allowed on a given route.
19    *
20    * While authentication itself is run before routing, this method is called
21    * after routing, hence RouteMatch is available and can be used to inspect
22    * route options.
23    *
24    * @param \Symfony\Component\HttpFoundation\Request $request
25    *   The request.
26    * @param bool $authenticated
27    *   Whether or not the request is authenticated.
28    *
29    * @return bool
30    *   TRUE if an authentication method is allowed on the request, otherwise
31    *   FALSE.
32    */
33   public function appliesToRoutedRequest(Request $request, $authenticated);
34
35 }