use of org.apereo.cas.pm.impl.JsonResourcePasswordManagementService in project cas by apereo.
the class PasswordManagementConfiguration method passwordChangeService.
@ConditionalOnMissingBean(name = "passwordChangeService")
@RefreshScope
@Bean
public PasswordManagementService passwordChangeService() {
final PasswordManagementProperties pm = casProperties.getAuthn().getPm();
if (pm.isEnabled()) {
final Resource location = pm.getJson().getLocation();
if (location != null) {
LOGGER.debug("Configuring password management based on JSON resource [{}]", location);
return new JsonResourcePasswordManagementService(passwordManagementCipherExecutor(), casProperties.getServer().getPrefix(), casProperties.getAuthn().getPm(), location);
}
LOGGER.warn("No storage service (LDAP, Database, etc) is configured to handle the account update and password service operations. " + "Password management functionality will have no effect and will be disabled until a storage service is configured. " + "To explicitly disable the password management functionality, add 'cas.authn.pm.enabled=false' to the CAS configuration");
} else {
LOGGER.debug("Password management is disabled. To enable the password management functionality, " + "add 'cas.authn.pm.enabled=true' to the CAS configuration and then configure storage options for account updates");
}
return new NoOpPasswordManagementService(passwordManagementCipherExecutor(), casProperties.getServer().getPrefix(), casProperties.getAuthn().getPm());
}
Aggregations