Search in sources :

Example 1 with JaasAuthenticationProvider

use of org.springframework.security.authentication.jaas.JaasAuthenticationProvider in project cas by apereo.

the class CasWebApplicationSecurityConfiguration method init.

@Override
public void init(final AuthenticationManagerBuilder auth) throws Exception {
    if (StringUtils.isNotBlank(casProperties.getAdminPagesSecurity().getJdbc().getQuery())) {
        auth.apply(new CasJdbcUserDetailsManagerConfigurer(casProperties.getAdminPagesSecurity()));
    }
    if (isLdapAuthorizationActive()) {
        auth.apply(new CasLdapUserDetailsManagerConfigurer<>(casProperties.getAdminPagesSecurity()));
    }
    final AdminPagesSecurityProperties.Jaas jaas = casProperties.getAdminPagesSecurity().getJaas();
    if (jaas.getLoginConfig() != null) {
        final JaasAuthenticationProvider p = new JaasAuthenticationProvider();
        p.setLoginConfig(jaas.getLoginConfig());
        p.setLoginContextName(jaas.getLoginContextName());
        p.setRefreshConfigurationOnStartup(jaas.isRefreshConfigurationOnStartup());
        auth.authenticationProvider(p);
    }
}
Also used : CasJdbcUserDetailsManagerConfigurer(org.apereo.cas.web.security.CasJdbcUserDetailsManagerConfigurer) AdminPagesSecurityProperties(org.apereo.cas.configuration.model.core.web.security.AdminPagesSecurityProperties) JaasAuthenticationProvider(org.springframework.security.authentication.jaas.JaasAuthenticationProvider)

Aggregations

AdminPagesSecurityProperties (org.apereo.cas.configuration.model.core.web.security.AdminPagesSecurityProperties)1 CasJdbcUserDetailsManagerConfigurer (org.apereo.cas.web.security.CasJdbcUserDetailsManagerConfigurer)1 JaasAuthenticationProvider (org.springframework.security.authentication.jaas.JaasAuthenticationProvider)1