You are here

interface TfaValidationInterface in Two-factor Authentication (TFA) 8

Interface TfaValidationInterface.

Validation plugins interact with the Tfa form processes to provide code entry and validate submitted codes.

Hierarchy

Expanded class hierarchy of TfaValidationInterface

All classes that implement TfaValidationInterface

4 files declare their use of TfaValidationInterface
TfaContextTest.php in tests/src/Unit/TfaContextTest.php
TfaRecoveryCode.php in src/Plugin/TfaValidation/TfaRecoveryCode.php
TfaTestValidationPlugin.php in tests/modules/tfa_test_plugins/src/Plugin/TfaValidation/TfaTestValidationPlugin.php
TfaTrustedBrowser.php in src/Plugin/TfaLogin/TfaTrustedBrowser.php

File

src/Plugin/TfaValidationInterface.php, line 13

Namespace

Drupal\tfa\Plugin
View source
interface TfaValidationInterface {

  /**
   * Get TFA process form from plugin.
   *
   * @param array $form
   *   The configuration form array.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   *
   * @return array
   *   Form API array.
   */
  public function getForm(array $form, FormStateInterface $form_state);

  /**
   * Validate form.
   *
   * @param array $form
   *   The configuration form array.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   *
   * @return bool
   *   Whether form passes validation or not
   */
  public function validateForm(array $form, FormStateInterface $form_state);

  /**
   * Check whether the user has setup Tfa for this validation plugin.
   *
   * @return bool
   *   Whether or not the user has setup this validation plugin.
   */
  public function ready();

}

Members

Namesort descending Modifiers Type Description Overrides
TfaValidationInterface::getForm public function Get TFA process form from plugin. 3
TfaValidationInterface::ready public function Check whether the user has setup Tfa for this validation plugin.
TfaValidationInterface::validateForm public function Validate form. 3