Class SpringSecurityPasswordEncoder

java.lang.Object
org.pac4j.core.credentials.password.SpringSecurityPasswordEncoder
All Implemented Interfaces:
PasswordEncoder

public class SpringSecurityPasswordEncoder extends Object implements PasswordEncoder
A password encoder based on PasswordEncoder from the Spring Security Crypto package. Add the spring-security-crypto dependency to use this class.
Since:
1.9.2
Author:
Victor Noël
  • Constructor Details

    • SpringSecurityPasswordEncoder

      public SpringSecurityPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder delegate)

      Constructor for SpringSecurityPasswordEncoder.

      Parameters:
      delegate - a PasswordEncoder object
  • Method Details

    • encode

      public String encode(String password)
      Encode a password.
      Specified by:
      encode in interface PasswordEncoder
      Parameters:
      password - the not encoded password
      Returns:
      the encoded password
    • matches

      public boolean matches(String plainPassword, String encodedPassword)
      Validate if a plainPassword matches
      Specified by:
      matches in interface PasswordEncoder
      Parameters:
      plainPassword - the not encoded password to check
      encodedPassword - the encoded password
      Returns:
      true if they match
    • getDelegate

      public org.springframework.security.crypto.password.PasswordEncoder getDelegate()

      Getter for the field delegate.

      Returns:
      a PasswordEncoder object