Class PasswordExpiryChecker

  • All Implemented Interfaces:
    org.springframework.security.core.userdetails.UserDetailsChecker

    public class PasswordExpiryChecker
    extends java.lang.Object
    implements org.springframework.security.core.userdetails.UserDetailsChecker
    Checks whether a user's password has changed within the configured expiry time.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void check​(org.springframework.security.core.userdetails.UserDetails toCheck)
      Checks if the given UserDetails password has expired.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PasswordExpiryChecker

        public PasswordExpiryChecker​(UserRepository userRepository,
                                     int passwordExpiryInDays)
        Build a PasswordExpiryChecker with a given UserRepository and configured password expiry date
        Parameters:
        userRepository - a UserRepository
        passwordExpiryInDays - number of days until a password expires
    • Method Detail

      • check

        public void check​(org.springframework.security.core.userdetails.UserDetails toCheck)
        Checks if the given UserDetails password has expired.
        Specified by:
        check in interface org.springframework.security.core.userdetails.UserDetailsChecker