Friday, August 18, 2023

Password Generation1

import sailpoint.api.PasswordGenerator;
import sailpoint.api.SailPointContext;
import sailpoint.object.Application;
import sailpoint.object.Identity;
import sailpoint.tools.GeneralException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class PasswordGeneration1 {

static SailPointContext context = null;
static Application application = null;
static Identity identity = null;
static Log logger = LogFactory.getLog("com.mightypedia.password.rule");

private static String generatePassword() throws GeneralException {

String returnPassword = "";
PasswordGenerator passwordGenerator = null;

try {
passwordGenerator = new PasswordGenerator(context);
returnPassword = passwordGenerator.generatePassword(identity, application);
} catch (GeneralException e) {

logger.error("GeneralException: " + e.getMessage());
returnPassword = passwordGenerator.generatePassword();
}
return returnPassword;
}

public static void main(String[] args) {

try {
String password = generatePassword();
} catch (GeneralException e) {
logger.error("GeneralException: " + e.getMessage());
}
}
}

No comments:

Post a Comment

Fetch Members from Workgroup

  import java.util.ArrayList;   import java.util.Iterator;   import java.util.List;   import sailpoint.api.ObjectUtil;   import sailpoint.ob...