use of org.apereo.cas.configuration.model.core.authentication.AuthenticationAttributeReleaseProperties in project cas by apereo.
the class CasCoreAuthenticationConfiguration method authenticationAttributeReleasePolicy.
@ConditionalOnMissingBean(name = "authenticationAttributeReleasePolicy")
@RefreshScope
@Bean
public AuthenticationAttributeReleasePolicy authenticationAttributeReleasePolicy() {
final AuthenticationAttributeReleaseProperties authenticationAttributeRelease = casProperties.getAuthn().getAuthenticationAttributeRelease();
final DefaultAuthenticationAttributeReleasePolicy policy = new DefaultAuthenticationAttributeReleasePolicy();
policy.setAttributesToRelease(authenticationAttributeRelease.getOnlyRelease());
final Set<String> attributesToNeverRelease = CollectionUtils.wrapSet(CasViewConstants.MODEL_ATTRIBUTE_NAME_PRINCIPAL_CREDENTIAL, RememberMeCredential.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME);
attributesToNeverRelease.addAll(authenticationAttributeRelease.getNeverRelease());
policy.setAttributesToNeverRelease(attributesToNeverRelease);
return policy;
}
Aggregations