You are here

DisallowSimpleOauthRequests.php in Simple OAuth (OAuth2) & OpenID Connect 8.2

File

src/PageCache/DisallowSimpleOauthRequests.php
View source
<?php

namespace Drupal\simple_oauth\PageCache;

use Drupal\Core\PageCache\RequestPolicyInterface;
use Drupal\simple_oauth\Authentication\Provider\SimpleOauthAuthenticationProvider;
use Drupal\simple_oauth\Server\ResourceServerInterface;
use Symfony\Component\HttpFoundation\Request;

/**
 * @internal
 */
class DisallowSimpleOauthRequests implements RequestPolicyInterface {

  /**
   * {@inheritdoc}
   */
  public function check(Request $request) {
    return SimpleOauthAuthenticationProvider::hasTokenValue($request) ? self::DENY : NULL;
  }

}

Classes

Namesort descending Description
DisallowSimpleOauthRequests @internal