You are here

class UsernamePassword in DRD Agent 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Agent/Auth/UsernamePassword.php \Drupal\drd_agent\Agent\Auth\UsernamePassword

Implements the UsernamePassword authentication method.

Hierarchy

Expanded class hierarchy of UsernamePassword

1 string reference to 'UsernamePassword'
Base::getMethods in src/Agent/Auth/Base.php
Get a list of all implemented authentication methods.

File

src/Agent/Auth/UsernamePassword.php, line 10

Namespace

Drupal\drd_agent\Agent\Auth
View source
class UsernamePassword extends Base {

  /**
   * {@inheritdoc}
   */
  public function validate(array $settings) : bool {
    if ($this->currentUser
      ->isAuthenticated()) {
      return TRUE;
    }
    return $this->userAuth
      ->authenticate($settings['username'], $settings['password']);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Base::$currentUser protected property
Base::$state protected property
Base::$storedSettings protected property All the settings of the implementing authentication method.
Base::$userAuth protected property
Base::create public static function
Base::getMethods public static function Get a list of all implemented authentication methods. Overrides BaseInterface::getMethods
Base::validateUuid final public function Verify if the given UUID is authorised to access this site. Overrides BaseInterface::validateUuid
Base::__construct public function Base constructor.
UsernamePassword::validate public function Validate authentication of the current request with the given settings. Overrides BaseInterface::validate