Interface ChangePasswordManager


  • public interface ChangePasswordManager
    The ChangePasswordManager allows a {link HippoSession} user to change its password
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long ONEDAYMS
      Number of milliseconds in one day
    • Field Detail

    • Method Detail

      • getPasswordMaxAgeDays

        long getPasswordMaxAgeDays()
                            throws javax.jcr.RepositoryException
        Provides the max age for passwords in days. When not configured (default) this returns -1L (no max age).
        Returns:
        the max age for passwords in days
        Throws:
        javax.jcr.RepositoryException - if the underlying HippoSession is no longer live, or something else went wrong
      • getPasswordMaxAgeMs

        long getPasswordMaxAgeMs()
                          throws javax.jcr.RepositoryException
        Provides the max age for passwords in milliseconds as convenience for calculating an expiration timestamp. When not configured (default) this returns -1L (no max age).
        Returns:
        the max age for passwords in milliseconds
        Throws:
        javax.jcr.RepositoryException - if the underlying HippoSession is no longer live, or something else went wrong
      • getPasswordLastModified

        Calendar getPasswordLastModified()
                                  throws javax.jcr.RepositoryException
        Returns the current password last modified date, or null if never changed
        Returns:
        the current password last modified date, or null if never changed
        Throws:
        javax.jcr.RepositoryException - if the underlying HippoSession is no longer live, or something else went wrong
      • checkPassword

        boolean checkPassword​(char[] password)
                       throws javax.jcr.RepositoryException
        Check the current user password
        Returns:
        true if the password is equal, false otherwise
        Throws:
        javax.jcr.RepositoryException - if the underlying HippoSession is no longer live, or something else went wrong
      • checkNewPasswordUsedBefore

        boolean checkNewPasswordUsedBefore​(char[] newPassword,
                                           int numberOfPreviousPasswordsToCheck)
                                    throws IllegalArgumentException,
                                           javax.jcr.RepositoryException
        Check if a new user password has been used before
        Parameters:
        newPassword - the new candidate password, must be non-empty and at least 4 characters long
        numberOfPreviousPasswordsToCheck - the number of last used passwords which are not allowed to be reused (use value 0 to disable/ignore checking previous passwords)
        Returns:
        true when the password is equal to the current password or has been used at least numberOfPreviousPasswordsToCheck before
        Throws:
        IllegalArgumentException - For an empty/null newPassword
        javax.jcr.RepositoryException - if the underlying HippoSession is no longer live, or something else went wrong
      • setPassword

        void setPassword​(char[] currentPassword,
                         char[] newPassword)
                  throws IllegalArgumentException,
                         javax.jcr.RepositoryException
        Update/set the current user password
        Parameters:
        currentPassword - the current password, must match otherwise IllegalStateException will be thrown. Note: for a first time password this parameter will be ignored!
        newPassword - the new password, must be non-empty and at least 4 characters long
        Throws:
        IllegalArgumentException - When the currentPassword doesn't match, for an empty/null newPassword, newPassword length < 4, or when newPassword is equal to the currentPassword
        javax.jcr.RepositoryException - if the underlying HippoSession is no longer live, or something else went wrong