Search in sources :

Example 1 with KerberosServiceAuthenticationProvider

use of org.springframework.security.kerberos.authentication.KerberosServiceAuthenticationProvider in project nifi by apache.

the class KerberosServiceFactoryBean method createKerberosServiceAuthenticationProvider.

private KerberosServiceAuthenticationProvider createKerberosServiceAuthenticationProvider() throws Exception {
    KerberosServiceAuthenticationProvider kerberosServiceAuthenticationProvider = new KerberosServiceAuthenticationProvider();
    kerberosServiceAuthenticationProvider.setTicketValidator(createTicketValidator());
    kerberosServiceAuthenticationProvider.setUserDetailsService(createAlternateKerberosUserDetailsService());
    kerberosServiceAuthenticationProvider.afterPropertiesSet();
    return kerberosServiceAuthenticationProvider;
}
Also used : KerberosServiceAuthenticationProvider(org.springframework.security.kerberos.authentication.KerberosServiceAuthenticationProvider)

Example 2 with KerberosServiceAuthenticationProvider

use of org.springframework.security.kerberos.authentication.KerberosServiceAuthenticationProvider in project kylo by Teradata.

the class KerberosSpnegoConfiguration method kerberosServiceAuthenticationProvider.

@Bean
public KerberosServiceAuthenticationProvider kerberosServiceAuthenticationProvider() throws IOException {
    KerberosServiceAuthenticationProvider provider = new KerberosServiceAuthenticationProvider();
    provider.setTicketValidator(sunJaasKerberosTicketValidator());
    // Since this provider requires a UserDetailsService even though we do not use UserDetals
    // set one here that only returns the a new UserDetails with the given username each time.
    provider.setUserDetailsService(username -> new User(username, "", Collections.emptySet()));
    return provider;
}
Also used : User(org.springframework.security.core.userdetails.User) KerberosServiceAuthenticationProvider(org.springframework.security.kerberos.authentication.KerberosServiceAuthenticationProvider) Bean(org.springframework.context.annotation.Bean)

Example 3 with KerberosServiceAuthenticationProvider

use of org.springframework.security.kerberos.authentication.KerberosServiceAuthenticationProvider in project nifi-registry by apache.

the class KerberosSpnegoFactory method kerberosServiceAuthenticationProvider.

private KerberosServiceAuthenticationProvider kerberosServiceAuthenticationProvider() throws Exception {
    if (kerberosServiceAuthenticationProvider == null && properties.isKerberosSpnegoSupportEnabled()) {
        KerberosServiceAuthenticationProvider ksap = new KerberosServiceAuthenticationProvider();
        ksap.setTicketValidator(kerberosTicketValidator);
        ksap.setUserDetailsService(new KerberosUserDetailsService());
        ksap.afterPropertiesSet();
        kerberosServiceAuthenticationProvider = ksap;
    }
    return kerberosServiceAuthenticationProvider;
}
Also used : KerberosServiceAuthenticationProvider(org.springframework.security.kerberos.authentication.KerberosServiceAuthenticationProvider)

Aggregations

KerberosServiceAuthenticationProvider (org.springframework.security.kerberos.authentication.KerberosServiceAuthenticationProvider)3 Bean (org.springframework.context.annotation.Bean)1 User (org.springframework.security.core.userdetails.User)1