Search in sources :

Example 1 with PasswordGenerator

use of com.sun.identity.password.plugins.PasswordGenerator in project OpenAM by OpenRock.

the class UpgradeServices method generateBackupPassword.

private String generateBackupPassword() {
    PasswordGenerator passwordGenerator = new RandomPasswordGenerator();
    String password = null;
    try {
        password = passwordGenerator.generatePassword(null);
    } catch (PWResetException pre) {
        // default implementation will not do this
        password = DEFAULT_PASSWORD;
    }
    return password;
}
Also used : PWResetException(com.sun.identity.password.ui.model.PWResetException) PasswordGenerator(com.sun.identity.password.plugins.PasswordGenerator) RandomPasswordGenerator(com.sun.identity.password.plugins.RandomPasswordGenerator) RandomPasswordGenerator(com.sun.identity.password.plugins.RandomPasswordGenerator)

Example 2 with PasswordGenerator

use of com.sun.identity.password.plugins.PasswordGenerator in project OpenAM by OpenRock.

the class PWResetQuestionModelImpl method getPasswordResetValue.

private String getPasswordResetValue(String realm, AMIdentity user) {
    String password = null;
    Object obj = getPluginObject(realm, PW_RESET_OPTION);
    try {
        if ((obj != null) && (obj instanceof PasswordGenerator)) {
            PasswordGenerator pwGenerator = (PasswordGenerator) obj;
            password = pwGenerator.generatePassword(user);
        }
    } catch (PWResetException e) {
        debug.error("PWResetQuestionModelImpl.getPasswordResetValue", e);
    }
    return password;
}
Also used : PasswordGenerator(com.sun.identity.password.plugins.PasswordGenerator)

Aggregations

PasswordGenerator (com.sun.identity.password.plugins.PasswordGenerator)2 RandomPasswordGenerator (com.sun.identity.password.plugins.RandomPasswordGenerator)1 PWResetException (com.sun.identity.password.ui.model.PWResetException)1