public interface ChangePasswordManager
Modifier and Type | Field and Description |
---|---|
static long |
ONEDAYMS
Number of milliseconds in one day
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkNewPasswordUsedBefore(char[] newPassword,
int numberOfPreviousPasswordsToCheck)
Check if a new user password has been used before
|
boolean |
checkPassword(char[] password)
Check the current user password
|
Calendar |
getPasswordLastModified()
Returns the current password last modified date, or null if never changed
|
long |
getPasswordMaxAgeDays()
Provides the max age for passwords in days.
|
long |
getPasswordMaxAgeMs()
Provides the max age for passwords in milliseconds as convenience for calculating an expiration timestamp.
|
void |
setPassword(char[] currentPassword,
char[] newPassword)
Update/set the current user password
|
static final long ONEDAYMS
long getPasswordMaxAgeDays() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if the underlying HippoSession is no longer live, or something else went wronglong getPasswordMaxAgeMs() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if the underlying HippoSession is no longer live, or something else went wrongCalendar getPasswordLastModified() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if the underlying HippoSession is no longer live, or something else went wrongboolean checkPassword(char[] password) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if the underlying HippoSession is no longer live, or something else went wrongboolean checkNewPasswordUsedBefore(char[] newPassword, int numberOfPreviousPasswordsToCheck) throws IllegalArgumentException, javax.jcr.RepositoryException
newPassword
- the new candidate password, must be non-empty and at least 4 characters longnumberOfPreviousPasswordsToCheck
- the number of last used passwords which are not allowed to be reused
(use value 0 to disable/ignore checking previous passwords)IllegalArgumentException
- For an empty/null newPasswordjavax.jcr.RepositoryException
- if the underlying HippoSession is no longer live, or something else went wrongvoid setPassword(char[] currentPassword, char[] newPassword) throws IllegalArgumentException, javax.jcr.RepositoryException
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 longIllegalArgumentException
- When the currentPassword doesn't match, for an empty/null newPassword,
newPassword length < 4, or when newPassword is equal to the currentPasswordjavax.jcr.RepositoryException
- if the underlying HippoSession is no longer live, or something else went wrongCopyright © 2007–2019 Hippo B.V. (http://www.onehippo.com). All rights reserved.