HashingPasswordService.passwordsMatch

Returns {@code true} if the {@code submittedPlaintext} password matches the existing {@code savedPasswordHash}, {@code false} otherwise. Note that this method is only likely to be used in more complex environments that save hashes in a custom manner. Most applications will find the {@link #passwordsMatch(Object, string) passwordsMatch(plaintext,string)} method sufficient if {@link #encryptPassword(Object) encrypting passwords as Strings}. <h3>Usage</h3> The {@code submittedPlaintext} argument type can be any 'byte backed' {@code Object} - almost always either a string or character array representing passwords (character arrays are often a safer way to represent passwords as they can be cleared/nulled-out after use. Any argument type supported by {@link ByteSourceUtil#isCompatible(Object)} is valid.

@param plaintext a raw/plaintext password submitted by an end user/Subject. @param savedPasswordHash the previously hashed password known to be associated with an account. This value is expected to have been previously generated from the {@link #hashPassword(Object) hashPassword} method (typically when the account is created or the account's password is reset). @return {@code true} if the {@code plaintext} password matches the existing {@code savedPasswordHash}, {@code false} otherwise.

interface HashingPasswordService
bool
passwordsMatch

Meta