Does anyone have working Beanshell code which generates, or validates, a password using a PasswordPolicy? (This will be in a BeforeProvisioning Rule). I can find various snippets in the preloaded Cloud rules, but it’s not clear to me if these will work for my purposes, and since this is a Cloud rule requiring SailPoint review, trial-and-error is not a good option.
For example I see this, but I’m not sure I can use this in the context of a BeforeProvisioning rule and these classes are not exposed in documentation:
import sailpoint.thunderbolt.service.ConnectorService;
import sailpoint.thunderbolt.service.module.ServiceModule;
ConnectorService connectorService = ServiceModule.getService(ConnectorService.class);
Field f = new Field();
return connectorService.generatePasswordBasedOnPolicy(context, application, identity, field);
I also see various snippets which use PasswordPolice to validate a password (also not in the java docs). This would also work for my purposes as I can generate the password randomly (not within policy) in a loop until it successfully validates against the application password policy:
PasswordPolice pp = new PasswordPolice(context);
pp.checkPassword(null, value, false);
Hoping that someone has already figured out the right methods to use! Please advise – thank you.