You are here

class AuthCodeRepository in Simple OAuth (OAuth2) & OpenID Connect 5.x

Same name and namespace in other branches
  1. 8.4 src/Repositories/AuthCodeRepository.php \Drupal\simple_oauth\Repositories\AuthCodeRepository

The repository for the Auth Code grant.

Hierarchy

Expanded class hierarchy of AuthCodeRepository

1 string reference to 'AuthCodeRepository'
simple_oauth.services.yml in ./simple_oauth.services.yml
simple_oauth.services.yml
1 service uses AuthCodeRepository
simple_oauth.repositories.auth_code in ./simple_oauth.services.yml
Drupal\simple_oauth\Repositories\AuthCodeRepository

File

src/Repositories/AuthCodeRepository.php, line 11

Namespace

Drupal\simple_oauth\Repositories
View source
class AuthCodeRepository implements AuthCodeRepositoryInterface {
  use RevocableTokenRepositoryTrait;

  /**
   * The bundle ID.
   *
   * @var string
   */
  protected static $bundleId = 'auth_code';

  /**
   * The OAuth2 entity class name.
   *
   * @var string
   */
  protected static $entityClass = 'Drupal\\simple_oauth\\Entities\\AuthCodeEntity';

  /**
   * The OAuth2 entity interface name.
   *
   * @var string
   */
  protected static $entityInterface = 'League\\OAuth2\\Server\\Entities\\AuthCodeEntityInterface';

  /**
   * {@inheritdoc}
   */
  public function getNewAuthCode() {
    return $this
      ->getNew();
  }

  /**
   * {@inheritdoc}
   */
  public function persistNewAuthCode(AuthCodeEntityInterface $auth_code_entity) {
    $this
      ->persistNew($auth_code_entity);
  }

  /**
   * {@inheritdoc}
   */
  public function revokeAuthCode($code_id) {
    $this
      ->revoke($code_id);
  }

  /**
   * {@inheritdoc}
   */
  public function isAuthCodeRevoked($code_id) {
    return $this
      ->isRevoked($code_id);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AuthCodeRepository::$bundleId protected static property The bundle ID.
AuthCodeRepository::$entityClass protected static property The OAuth2 entity class name.
AuthCodeRepository::$entityInterface protected static property The OAuth2 entity interface name.
AuthCodeRepository::getNewAuthCode public function
AuthCodeRepository::isAuthCodeRevoked public function
AuthCodeRepository::persistNewAuthCode public function
AuthCodeRepository::revokeAuthCode public function
RevocableTokenRepositoryTrait::$entityTypeId protected static property The entity type ID.
RevocableTokenRepositoryTrait::$entityTypeManager protected property The entity type manager.
RevocableTokenRepositoryTrait::$serializer protected property The serializer.
RevocableTokenRepositoryTrait::getNew public function
RevocableTokenRepositoryTrait::isRevoked public function
RevocableTokenRepositoryTrait::persistNew public function
RevocableTokenRepositoryTrait::revoke public function
RevocableTokenRepositoryTrait::__construct public function Construct a revocable token.