You are here

public function BasicAuth::applies in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/basic_auth/src/Authentication/Provider/BasicAuth.php \Drupal\basic_auth\Authentication\Provider\BasicAuth::applies()
  2. 9 core/modules/basic_auth/src/Authentication/Provider/BasicAuth.php \Drupal\basic_auth\Authentication\Provider\BasicAuth::applies()

File

core/modules/basic_auth/src/Authentication/Provider/BasicAuth.php, line 72

Class

BasicAuth
HTTP Basic authentication provider.

Namespace

Drupal\basic_auth\Authentication\Provider

Code

public function applies(Request $request) {
  $username = $request->headers
    ->get('PHP_AUTH_USER');
  $password = $request->headers
    ->get('PHP_AUTH_PW');
  return isset($username) && isset($password);
}