You are here

public function SimpleOauthAuthenticationProvider::applies in Simple OAuth (OAuth2) & OpenID Connect 5.x

Same name and namespace in other branches
  1. 8.4 src/Authentication/Provider/SimpleOauthAuthenticationProvider.php \Drupal\simple_oauth\Authentication\Provider\SimpleOauthAuthenticationProvider::applies()
  2. 8 src/Authentication/Provider/SimpleOauthAuthenticationProvider.php \Drupal\simple_oauth\Authentication\Provider\SimpleOauthAuthenticationProvider::applies()
  3. 8.2 src/Authentication/Provider/SimpleOauthAuthenticationProvider.php \Drupal\simple_oauth\Authentication\Provider\SimpleOauthAuthenticationProvider::applies()
  4. 8.3 src/Authentication/Provider/SimpleOauthAuthenticationProvider.php \Drupal\simple_oauth\Authentication\Provider\SimpleOauthAuthenticationProvider::applies()

Checks whether suitable authentication credentials are on the request.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request object.

Return value

bool TRUE if authentication credentials suitable for this provider are on the request, FALSE otherwise.

Overrides AuthenticationProviderInterface::applies

File

src/Authentication/Provider/SimpleOauthAuthenticationProvider.php, line 57

Class

SimpleOauthAuthenticationProvider
@internal

Namespace

Drupal\simple_oauth\Authentication\Provider

Code

public function applies(Request $request) {

  // The request policy service won't be used in case of non GET or HEAD
  // methods so we have to explicitly call it.

  /* @see \Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod::check() */
  return $this->oauthPageCacheRequestPolicy
    ->isOauth2Request($request);
}