Class CustomPasswordEncoder

java.lang.Object
org.opencastproject.kernel.security.CustomPasswordEncoder
All Implemented Interfaces:
org.springframework.security.crypto.password.PasswordEncoder

public class CustomPasswordEncoder extends Object implements org.springframework.security.crypto.password.PasswordEncoder
Password encoder using bcrypt for password hashing Breaking change: no more backwards support for very old md5 based passwords.
  • Constructor Details

    • CustomPasswordEncoder

      public CustomPasswordEncoder()
  • Method Details

    • encode

      public String encode(CharSequence rawPassword)
      Encode the raw password for storage using bcrypt.
      Specified by:
      encode in interface org.springframework.security.crypto.password.PasswordEncoder
      Parameters:
      rawPassword - raw password to encrypt/hash
      Returns:
      hashed password
    • matches

      public boolean matches(CharSequence rawPassword, String encodedPassword)
      Verify the encoded password obtained from storage matches the submitted raw password after it too is encoded. Returns true if the passwords match, false if they do not. The stored password itself is never decoded.
      Specified by:
      matches in interface org.springframework.security.crypto.password.PasswordEncoder
      Parameters:
      rawPassword - the raw password to encode and match
      encodedPassword - the encoded password from storage to compare with
      Returns:
      true if the raw password, after encoding, matches the encoded password from storage