public class

PlaintextPasswordEncoder

extends BasePasswordEncoder
java.lang.Object
   ↳ org.springframework.security.authentication.encoding.BasePasswordEncoder
     ↳ org.springframework.security.authentication.encoding.PlaintextPasswordEncoder

Class Overview

Plaintext implementation of PasswordEncoder.

As callers may wish to extract the password and salts separately from the encoded password, the salt must not contain reserved characters (specifically '{' and '}').

Summary

Public Constructors
PlaintextPasswordEncoder()
Public Methods
String encodePassword(String rawPass, Object salt)
boolean isIgnorePasswordCase()
boolean isPasswordValid(String encPass, String rawPass, Object salt)
String[] obtainPasswordAndSalt(String password)
Demerges the previously encodePassword(String, Object)String.
void setIgnorePasswordCase(boolean ignorePasswordCase)
Indicates whether the password comparison is case sensitive.
[Expand]
Inherited Methods
From class org.springframework.security.authentication.encoding.BasePasswordEncoder
From class java.lang.Object
From interface org.springframework.security.authentication.encoding.PasswordEncoder

Public Constructors

public PlaintextPasswordEncoder ()

Public Methods

public String encodePassword (String rawPass, Object salt)

public boolean isIgnorePasswordCase ()

public boolean isPasswordValid (String encPass, String rawPass, Object salt)

public String[] obtainPasswordAndSalt (String password)

Demerges the previously encodePassword(String, Object)String.

The resulting array is guaranteed to always contain two elements. The first is the password, and the second is the salt.

Throws an exception if null or an empty String is passed to the method.

Parameters
password from encodePassword(String, Object)
Returns
  • an array containing the password and salt

public void setIgnorePasswordCase (boolean ignorePasswordCase)

Indicates whether the password comparison is case sensitive.

Defaults to false, meaning an exact case match is required.

Parameters
ignorePasswordCase set to true for less stringent comparison