Configuring Password Rules

The interface PasswordRules provides functionality to determine and get password rules.

Please also refer to the Javadoc of org.eclipse.stardust.engine.api.runtime.PasswordRules for detailed information on the according methods.

Configuring Password Expiration Periods

To determine the period a password is valid, use the method

void setExpirationTime(int days)

The method

int getExpirationTime()

returns the number of days a password is valid.

Configuring Password Strength Rules

The following password strength rules can be set and get by using the according methods:

Configuring the Number of Previous User Passwords to Remember

The method

 void setPasswordTracking(int number)

sets the number of old passwords to store. If the value is greater than 0, the password tracking is enabled and a number of previous passwords is stored. The new password should not have the same value as one of the stored previous passwords.

To check if password tracking is enabled, use the method

int getPasswordTracking()

It return the number of passwords to track.

Setting a Flag for Unique Password Requirement

You can set a flag for using unique passwords, so that new passwords should be compared with previous passwords, via the following method:

void setUniquePassword(boolean uniquePassword);

To check, if this flag is set, use:

boolean isUniquePassword();

Sending Notification Mails

Via the method

void setNotificationMails(int days)

you can determine that a notification mail should be send out before the password expires. The parameter is the number of days the notification mail should be sent before the password expires. In case no notification mail should be sent, set the parameter to 0.

Use the method

int getNotificationMails();

to check if notification mails should be send. The return value is the number of days the mail should go out before the password expires. If the value is 0, no notification should be sent.

Setting a Flag for Forcing a Password Change

To force a password change, use the method

void setForcePasswordChange(boolean forcePasswordChange);

You can check if the force password change flag is set via:

boolean isForcePasswordChange();

Enable or Disable Password Validation

To determine if all password rules should be validated, use the method:

void setStrongPassword(boolean strongPassword);

To check if the strong password is set, use:

boolean isStrongPassword();

Determine Time to Deactivate User IDs

To set the number of days a user ID will be disabled after the password expired, use the method:

void setDisableUserTime(int days)

The method

int getDisableUserTime()

returns the number of days a user ID will be disabled after the password expired.