interface PasswordInterface in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Password/PasswordInterface.php \Drupal\Core\Password\PasswordInterface
Secure password hashing functions for user authentication.
Hierarchy
- interface \Drupal\Core\Password\PasswordInterface
Expanded class hierarchy of PasswordInterface
All classes that implement PasswordInterface
5 files declare their use of PasswordInterface
- EntityUser.php in core/
modules/ user/ src/ Plugin/ migrate/ destination/ EntityUser.php - Contains \Drupal\user\Plugin\migrate\destination\EntityUser.
- MigratePassword.php in core/
modules/ user/ src/ MigratePassword.php - Contains \Drupal\user\MigratePassword.
- PasswordHashingTest.php in core/
tests/ Drupal/ Tests/ Core/ Password/ PasswordHashingTest.php - Contains \Drupal\Tests\Core\Password\PasswordHashingTest.
- UserAuth.php in core/
modules/ user/ src/ UserAuth.php - Contains \Drupal\user\UserAuth.
- UserStorage.php in core/
modules/ user/ src/ UserStorage.php - Contains \Drupal\user\UserStorage.
File
- core/
lib/ Drupal/ Core/ Password/ PasswordInterface.php, line 13 - Contains \Drupal\Core\Password\PasswordInterface.
Namespace
Drupal\Core\PasswordView source
interface PasswordInterface {
/**
* Maximum password length.
*/
const PASSWORD_MAX_LENGTH = 512;
/**
* Hash a password using a secure hash.
*
* @param string $password
* A plain-text password.
*
* @return string
* A string containing the hashed password, or FALSE on failure.
*/
public function hash($password);
/**
* Check whether a plain text password matches a hashed password.
*
* @param string $password
* A plain-text password
* @param string $hash
* A hashed password.
*
* @return bool
* TRUE if the password is valid, FALSE if not.
*/
public function check($password, $hash);
/**
* Check whether a hashed password needs to be replaced with a new hash.
*
* This is typically called during the login process when the plain text
* password is available. A new hash is needed when the desired iteration
* count has changed by a modification of the password-service in the
* dependency injection container or if the user's password hash was
* generated in an update like user_update_7000() (see the Drupal 7
* documentation).
*
* @param string $hash
* The existing hash to be checked.
*
* @return bool
* TRUE if the hash is outdated and needs rehash.
*/
public function needsRehash($hash);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PasswordInterface:: |
public | function | Check whether a plain text password matches a hashed password. | 2 |
PasswordInterface:: |
public | function | Hash a password using a secure hash. | 2 |
PasswordInterface:: |
public | function | Check whether a hashed password needs to be replaced with a new hash. | 2 |
PasswordInterface:: |
constant | Maximum password length. |