use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class WsFedAuthenticationEventExecutionPlanConfiguration method wsFederationConfigurations.
@ConditionalOnMissingBean(name = "wsFederationConfigurations")
@Bean
@RefreshScope
public Collection<WsFederationConfiguration> wsFederationConfigurations() {
final Collection<WsFederationConfiguration> col = new HashSet<>();
casProperties.getAuthn().getWsfed().forEach(wsfed -> {
final WsFederationConfiguration cfg = getWsFederationConfiguration(wsfed);
col.add(cfg);
});
return col;
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class LdapServiceRegistryConfiguration method ldapServiceRegistry.
@Bean
@RefreshScope
public ServiceRegistry ldapServiceRegistry() {
final LdapServiceRegistryProperties ldap = casProperties.getServiceRegistry().getLdap();
final ConnectionFactory connectionFactory = LdapUtils.newLdaptivePooledConnectionFactory(ldap);
return new LdapServiceRegistry(connectionFactory, ldap.getBaseDn(), ldapServiceRegistryMapper(), ldap);
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class MongoDbTicketRegistryConfiguration method ticketRegistry.
@RefreshScope
@Bean
@Autowired
public TicketRegistry ticketRegistry(@Qualifier("ticketCatalog") final TicketCatalog ticketCatalog) {
final MongoTicketRegistryProperties mongo = casProperties.getTicket().getRegistry().getMongo();
final MongoDbTicketRegistry registry = new MongoDbTicketRegistry(ticketCatalog, mongoDbTicketRegistryTemplate(), mongo.isDropCollection());
registry.setCipherExecutor(CoreTicketUtils.newTicketRegistryCipherExecutor(mongo.getCrypto(), "mongo"));
return registry;
}
use of org.springframework.cloud.context.config.annotation.RefreshScope 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.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class SpnegoConfiguration method spnegoHandler.
@Bean
@RefreshScope
public AuthenticationHandler spnegoHandler() {
final SpnegoProperties spnegoProperties = casProperties.getAuthn().getSpnego();
final JcifsSpnegoAuthenticationHandler h = new JcifsSpnegoAuthenticationHandler(spnegoProperties.getName(), servicesManager, spnegoPrincipalFactory(), spnegoAuthentication(), spnegoProperties.isPrincipalWithDomainName(), spnegoProperties.isNtlmAllowed());
h.setAuthentication(spnegoAuthentication());
h.setPrincipalWithDomainName(spnegoProperties.isPrincipalWithDomainName());
h.setNtlmAllowed(spnegoProperties.isNtlmAllowed());
return h;
}
Aggregations