use of org.apereo.cas.configuration.model.support.generic.ShiroAuthenticationProperties in project cas by apereo.
the class ShiroAuthenticationConfiguration method shiroAuthenticationHandler.
@RefreshScope
@Bean
public AuthenticationHandler shiroAuthenticationHandler() {
final ShiroAuthenticationProperties shiro = casProperties.getAuthn().getShiro();
final ShiroAuthenticationHandler h = new ShiroAuthenticationHandler(shiro.getName(), servicesManager, shiroPrincipalFactory(), shiro.getRequiredRoles(), shiro.getRequiredPermissions());
h.loadShiroConfiguration(shiro.getLocation());
h.setPasswordEncoder(PasswordEncoderUtils.newPasswordEncoder(shiro.getPasswordEncoder()));
if (shiroPasswordPolicyConfiguration != null) {
h.setPasswordPolicyConfiguration(shiroPasswordPolicyConfiguration);
}
h.setPrincipalNameTransformer(PrincipalNameTransformerUtils.newPrincipalNameTransformer(shiro.getPrincipalTransformation()));
return h;
}
use of org.apereo.cas.configuration.model.support.generic.ShiroAuthenticationProperties in project cas by apereo.
the class ShiroAuthenticationEventExecutionPlanConfiguration method shiroAuthenticationHandler.
@RefreshScope
@Bean
public AuthenticationHandler shiroAuthenticationHandler() {
final ShiroAuthenticationProperties shiro = casProperties.getAuthn().getShiro();
final ShiroAuthenticationHandler h = new ShiroAuthenticationHandler(shiro.getName(), servicesManager, shiroPrincipalFactory(), shiro.getRequiredRoles(), shiro.getRequiredPermissions());
h.loadShiroConfiguration(shiro.getConfig().getLocation());
h.setPasswordEncoder(Beans.newPasswordEncoder(shiro.getPasswordEncoder()));
if (shiroPasswordPolicyConfiguration != null) {
h.setPasswordPolicyConfiguration(shiroPasswordPolicyConfiguration);
}
h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(shiro.getPrincipalTransformation()));
return h;
}
Aggregations