You are here

interface OpenIDConnectStateTokenInterface in OpenID Connect / OAuth client 8

Same name and namespace in other branches
  1. 2.x src/OpenIDConnectStateTokenInterface.php \Drupal\openid_connect\OpenIDConnectStateTokenInterface

Creates and validates state tokens.

@package Drupal\openid_connect

Hierarchy

Expanded class hierarchy of OpenIDConnectStateTokenInterface

All classes that implement OpenIDConnectStateTokenInterface

2 files declare their use of OpenIDConnectStateTokenInterface
OpenIDConnectClientBase.php in src/Plugin/OpenIDConnectClientBase.php
OpenIDConnectRedirectController.php in src/Controller/OpenIDConnectRedirectController.php

File

src/OpenIDConnectStateTokenInterface.php, line 10

Namespace

Drupal\openid_connect
View source
interface OpenIDConnectStateTokenInterface {

  /**
   * Creates a state token and stores it in the session for later validation.
   *
   * @return string
   *   A state token that later can be validated to prevent request forgery.
   *
   * @deprecated in openid_connect:8.x-1.0-rc2 and is removed from openid_connect:8.x-2.0.
   *   Instead of the static OpenIDConnectStateToken::create, use the non-static
   *   \Drupal::service('openid_connect.state_token')->create() instead.
   * @see https://www.drupal.org/project/openid_connect/issues/3055847
   */
  public static function create();

  /**
   * Confirms anti-forgery state token.
   *
   * @param string $state_token
   *   The state token that is used for validation.
   *
   * @return bool
   *   Whether the state token matches the previously created one that is stored
   *   in the session.
   *
   * @deprecated in openid_connect:8.x-1.0-rc2 and is removed from openid_connect:8.x-2.0.
   *   Instead of the static OpenIDConnectStateToken::confirm use the non-static
   *   \Drupal::service('openid_connect.state_token')->confirm() instead.
   * @see https://www.drupal.org/project/openid_connect/issues/3055847
   */
  public static function confirm($state_token);

}

Members

Namesort descending Modifiers Type Description Overrides
OpenIDConnectStateTokenInterface::confirm Deprecated public static function Confirms anti-forgery state token. 1
OpenIDConnectStateTokenInterface::create Deprecated public static function Creates a state token and stores it in the session for later validation. 1