use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class CasConsentCoreConfiguration method consentCipherExecutor.
@ConditionalOnMissingBean(name = "consentCipherExecutor")
@Bean
@RefreshScope
public CipherExecutor consentCipherExecutor() {
final ConsentProperties consent = casProperties.getConsent();
final EncryptionJwtSigningJwtCryptographyProperties crypto = consent.getCrypto();
if (crypto.isEnabled()) {
return new AttributeReleaseConsentCipherExecutor(crypto.getEncryption().getKey(), crypto.getSigning().getKey(), crypto.getAlg());
}
LOGGER.debug("Consent attributes stored by CAS are not signed/encrypted.");
return CipherExecutor.noOp();
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class CouchbaseAuthenticationConfiguration method authenticationCouchbaseClientFactory.
@ConditionalOnMissingBean(name = "authenticationCouchbaseClientFactory")
@RefreshScope
@Bean
public CouchbaseClientFactory authenticationCouchbaseClientFactory() {
final CouchbaseAuthenticationProperties couchbase = casProperties.getAuthn().getCouchbase();
final Set<String> nodes = org.springframework.util.StringUtils.commaDelimitedListToSet(couchbase.getNodeSet());
return new CouchbaseClientFactory(nodes, couchbase.getBucket(), couchbase.getPassword());
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class GoogleAuthenticatorAuthenticationEventExecutionPlanConfiguration method googleAuthenticatorAuthenticationProvider.
@Bean
@RefreshScope
public MultifactorAuthenticationProvider googleAuthenticatorAuthenticationProvider() {
final GAuthMultifactorProperties gauth = casProperties.getAuthn().getMfa().getGauth();
final GoogleAuthenticatorMultifactorAuthenticationProvider p = new GoogleAuthenticatorMultifactorAuthenticationProvider();
p.setBypassEvaluator(googleBypassEvaluator());
p.setGlobalFailureMode(casProperties.getAuthn().getMfa().getGlobalFailureMode());
p.setOrder(gauth.getRank());
p.setId(gauth.getId());
return p;
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class JsonResourceAuthenticationEventExecutionPlanConfiguration method jsonResourceAuthenticationHandler.
@RefreshScope
@Bean
public AuthenticationHandler jsonResourceAuthenticationHandler() {
final JsonResourceAuthenticationProperties jsonProps = casProperties.getAuthn().getJson();
final JsonResourceAuthenticationHandler h = new JsonResourceAuthenticationHandler(jsonProps.getName(), servicesManager, jsonPrincipalFactory(), null, jsonProps.getLocation());
h.setPasswordEncoder(PasswordEncoderUtils.newPasswordEncoder(jsonProps.getPasswordEncoder()));
if (jsonProps.getPasswordPolicy().isEnabled()) {
h.setPasswordPolicyConfiguration(new PasswordPolicyConfiguration(jsonProps.getPasswordPolicy()));
}
h.setPrincipalNameTransformer(PrincipalNameTransformerUtils.newPrincipalNameTransformer(jsonProps.getPrincipalTransformation()));
return h;
}
use of org.springframework.cloud.context.config.annotation.RefreshScope in project cas by apereo.
the class RejectUsersAuthenticationEventExecutionPlanConfiguration method rejectUsersAuthenticationHandler.
@RefreshScope
@Bean
public AuthenticationHandler rejectUsersAuthenticationHandler() {
final RejectAuthenticationProperties rejectProperties = casProperties.getAuthn().getReject();
final Set<String> users = org.springframework.util.StringUtils.commaDelimitedListToSet(rejectProperties.getUsers());
final RejectUsersAuthenticationHandler h = new RejectUsersAuthenticationHandler(rejectProperties.getName(), servicesManager, rejectUsersPrincipalFactory(), users);
h.setPasswordEncoder(PasswordEncoderUtils.newPasswordEncoder(rejectProperties.getPasswordEncoder()));
if (rejectPasswordPolicyConfiguration != null) {
h.setPasswordPolicyConfiguration(rejectPasswordPolicyConfiguration);
}
h.setPrincipalNameTransformer(PrincipalNameTransformerUtils.newPrincipalNameTransformer(rejectProperties.getPrincipalTransformation()));
return h;
}
Aggregations